javascript - how to loop through anchor tags in a variable using Jquery -


i have js variable

var content = "<p><a href="http://www.wikipedia.org">wiki</a></p>"; 

i need add class anchor tag.

is possible in jquery ?

you can use:

$(content).find('a').addclass('myclass'); 

Comments

Popular posts from this blog

python - Redis Error 8 connecting localhost:6379. nodename nor servname provided, or not known -

c# - How to get the current UAC mode -