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

Popular posts from this blog

Cursor error with postgresql, pgpool and php -

delphi - ESC/P programming! -

c++ - error: use of deleted function -