Java Script Find and Replace

This small section of java script will allow you to replace any text on either the search or VDP. You will just be sure to input the correct ‘class’ or ‘id’. And then replace the FIND and REPLACE. With what you want to find and replace.

[cc lang=’javascript’ ]

jQuery(‘CLASS or ID’).each(function(){
if (jQuery(this).text().match(/FIND/i) != null){
jQuery(this).html(jQuery(this).html().replace(/FIND/i, ‘REPLACE’));
}
});

[/cc]

Leave a Reply