下面的语句产生错误:错误使用jQuery包含()
TypeError: $(...).children(...).contains is not a function
$('.woocommerce-checkout .shop_table tr.cart_item dl.variation').each(function() {
if ($(this).children('.variation-Billing').contains("Once Off")) {
$(this).children('.variation-Billing').contains("Once Off").show().siblings('.variation-Billing').show();
}
});
我做了什么错?
让我们看看您的HTML代码。 –
显示您的完整代码或制作小提琴链接。 – Sumanta736
也许你被[$ .contains()](https://api.jquery.com/jQuery.contains/)与[:contains selector](https://api.jquery.com)无关/包含选择器/)。但错误是正确的,jQuery没有方法'$ .fn.contains()',因为你正在尝试使用它 –