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 - matpltolib navigation toolbar edit curves and parameters line color automatically changes issue -

node.js - Nodejs javascript implementation of PBEWithMD5AndTripleDES/CBC/PKCS5Padding -