Posted By

vaughanj on 02/01/13


word replacefindswap

Versions (?)

Quick Text swap (Find and Replace string)

 / Published in: jQuery

Finds a matching string in a DOM element and replaces it with another string.

Originally used to change "[Entries] in CategoryA" to "[Projects] in CategoryA".

  1. $("#header h2").each(function(){
  2. $(this).text($(this).text().replace("swap this", "for this"));
  3. });

Report this snippet  

You need to login to post a comment.