I am trying to at the moment simply alert if an element contains specific text string. Here is what I have so far -
<div class="first">This is the first div</div>
<div class="second">This is the second div</div>
if($(".first:contains('first')")){
alert("Found It!");
}
My problem is, it will alert the message regardless, I f I change it to a String that is not in any of the elements it will still output the alert.
Can anyone see where I am going wrong?
Thanks