I have a class for DIVs called .post and I’d like to find words inside that element and replace them with something else. That words must also not be inside elements with other classes (.tiptrig and .postheader).
I’d really like to achieve this but I don’t know how… I am new to Javascript and especially jQuery.
Seems like an easy task.
This would iterate over all nodes which own the class
.postand replace the word THEWORD with something else. Be aware of that his is dangerous too because you could also modify HTML tag names for instance. So this only makes sense if you want to add/modify HTML code aswell.demo: http://www.jsfiddle.net/XGuGy/
Probably a better idea to access the
text():demo: http://www.jsfiddle.net/XGuGy/1/