Tell me how to find and replace the text in the whole document?
For example
& lt; div & gt; QWEQWE & LT; / DIV & GT;
& lt; img scr = "img / qweqwe.jpg" & gt;
Change QWeqWe on ASDF
Answer 1, Authority 100%
$ ("span, p, div"). Each (function () {
var text = $ (this) .text ();
text = text.replace ("QWeqwe", "ASDF");
$ (this) .text (text);
});
We take place on all SPAN
, P
and DIV
and change the text in them.
Attributes, of course, do not touch. Therefore, in IMG
you have the name of the file and remain the same (I hope you do not have the same attributes and tags to rename).