Javascript: How can I replace the contents of a string but not in an HTML tag? -


i want write javascript function change text lasvegas in string: example:

"hello every 1 in lasvegas, come <a href='xxx'>lasvegas</a> me"

how can change text "lasvegas" not change content lasvegas in html tag?

may that

str.replace(/lasvegas[^<]/,'123') 

Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -