javascript - Remove text from a p tag and add a class with jquery -


what i'm triying accomplish there's p tag word "border" on it remove text inside (the word border) , add class p. far works finding p , adding class. how can remove text?

$('#main-body-content').find('p').filter(':contains(border)').addclass("border"); 

try this......

$('#main-body-content').find('p').filter(':contains(border)').text("").addclass("border"); 

demo


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -