In order to process HTML with JavaScript please use 'html' variable name. Code examples:
Replace first occurrence of 'xxx' word with 'yyy' word: html = html.replace("xxx","yyy");
Replace all p tags with span tags with regexp: html = html.replace(/<p([^<>]*)>(.*)<\/p>/g,"<span$1>$2</span>");
Remove all p tags with inner content with regexp: html = html.replace(/<p[^<>]*>(.*)<\/p>/g,"");
Advanced example - match inner text of all tags and replace start " with <blockquote> and end " with </blockquote>:
html = html.replace(/>([^<>]+)</gi, function(m, p1) { return ">" + p1.replace(/([^<>"]*)"([^<>"]*)"/gi, '$1<blockquote>$2</blockquote>') + "<"; } );
Click here to see more info about JavaScript string functions...
Select your options then click the green 'Cleanup HTML' button