我正在尝试在 div
中查找文本。我的代码适用于除 IE7 以外的所有浏览器。
代码如下:
<div class="demo">
Preveiw
</div>
J查询:
$(".demo:contains('Preveiw').length") // returns 0 in IE7
最佳答案
试试这个
$(".demo:contains('Preveiw')").length
关于javascript - jQuery :contains not working in ie7 (jQuery 1. 3.5),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8816723/