Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery :contains not working in ie7 (jQuery 1.3.5)

I'm trying to find a text inside a div. The code I have works in all browsers except IE7.

Below is the code:

<div class="demo"> 
   Preveiw
</div>

Jquery:

$(".demo:contains('Preveiw').length") // returns 0 in IE7
like image 368
Nitesh morajkar Avatar asked Feb 04 '26 08:02

Nitesh morajkar


1 Answers

Try this instead

$(".demo:contains('Preveiw')").length
like image 190
Stefan Avatar answered Feb 05 '26 22:02

Stefan