jquery - Find certain text on page and make it underlined -
how find text on web page , make underlined?
for example, have text on page , want find words hello
, make them underlined.
my trial code is:
$( "body:contains('hello')" ).css( "text-decoration", "underline" );
but ends underlining whole line instead of word.
try this.
html
<p>for example, have text on page , want find words hello , make them bold.</p>
script
$('p').html( $('p').html().replace(/hello/g, '<strong>hello</strong>') )
Comments
Post a Comment