i need to enable a div only if a span has certain text, yet the div gets enabled no matter what i put in the “contains” brackets. Even random gibberish.
In my page’s head I reference google’s jquery
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
Then run my script right before the closing body tag
<script>
if($("span:contains('abc123')")){
document.getElementById("mydiv").style.display = "block";
}
</script>
What am I doing wrong?
Thanks a lot for any help!!
I would do something like below: