javascript - How to check a text in HTML content using jQuery? -
i want check particular word/text in html content using jquery. eg: let html content be
<p>i love stackoverflow</p>
so how can check & highlight sentence if contains word 'love'?
thanks in advance. :)
you can use jquery.contains()
$(document).ready(function(){ $("p:contains('love')").css("background-color","red"); });
hope helps!!!
Comments
Post a Comment