Is there a way to tell jQuery that you want what ever comes after text()
or html()
to be applied to it? Hard to explain, easier to show:
$("#someElement").html().replace(oldWord, newWord, "g");
The above won't change the DOM, you'd have to do:
$("#someElement").html($("#someElement").html().replace(oldWord, newWord, "g"));
which is a pain in the a**.
edit: What I'd like to see though, is the possiblity to do this:
$("#someElement").html(.replace(oldWord, newWord("g"));
Don't know if that would be possible, or even practical, really. Is there a reason this couldn't be done?