jQuery Search/Replace

[javascript]
jQuery(function () {
jQuery(":contains(FIND)").not(":has(:contains(FIND))").each(function () {
var that = $(this),
html = that.html();

html = html.replace(/(\(FIND:.*?\))/g, "REPLACE-WITH");
that.html(html);
});
});
[/javascript]

Leave a Reply