Posted By

jackkeller on 11/01/11


Tagged

jquery


Versions (?)

Search/Replace


 / Published in: JavaScript
 

  1. jQuery(function () {
  2.     jQuery(":contains(FIND)").not(":has(:contains(FIND))").each(function () {
  3.         var that = $(this),
  4.             html = that.html();
  5.  
  6.         html = html.replace(/(\(FIND:.*?\))/g, "REPLACE-WITH");
  7.         that.html(html);
  8.     });
  9. });

Report this snippet  

You need to login to post a comment.