javascript - jQuery :contains not working in ie7 (jQuery 1. 3.5)

标签 javascript jquery internet-explorer-7

我正在尝试在 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/

相关文章:

javascript - jQuery 导航在 IE7 中不工作

jquery - 使用 jQuery 瞄准 IE7

javascript - 如何优化此数据馈送函数中的 if 语句?

javascript - 如何将 jquery 对象呈现为 html - 参见 [object Object]

jQuery 为什么 $ ('tr' ).slideDown ('slow' );打破表格布局?

jquery - Grails ajax 获得成功和错误

jquery mobile tap 事件触发一次然后导致问题

css - 如何在 IE 6-8 中修复 PNG 定位

javascript - 取消选中并模拟单击 Javascript 中的复选框

javascript - jQuery Accordion 在扩展时自动选择所有包含文本