Using jQuery, I need to parse the contents of each <p>
tag individually and then replace the text with the new text.
The code at the moment looks like:
str = $('p').text();
str = str.replace('yadayada','yada');
$('p').text(str);
This is currently getting the contents of all the <p>
tags, concatenating them then replacing the massive block of text into each <p>
which is close but not quite what I'd like it to do.
Is there a way to get the contents of each <p>
block one at a time and replacing it with only it's contents? I do not know what ids or classes are being applied to them hence the need to use the generic tag.
Any help is much appreciated! :)