Reputation: 431
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
Upvotes: 3
Views: 512
Reputation: 3419
It could be that jQuery has not loaded yet try putting your script at the bottom of the page within
<script defer="defer">
which will rule that out and the code within
$(document).ready(function() {
alert($(".demo:contains('Preveiw')").length);
});
which could be another problem.
here it is on jsFiddle http://jsfiddle.net/kamui/VfhQ6/2/
Upvotes: 1