Applying DOM Manipulations to HTML and saving the result?
I have about 100 static HTML pages that I want to apply some DOM manipulations to. They all follow the same HTML structure. I want to apply some DOM manipulations to each of these files, and then save the resulting HTML. These are the manipulations I want to apply: # [start] $("h1.title, h2.description", this).wrap("<hgroup>"); if ( $("h1.title").height() < 200 ) { $("div.content").addClass('tall'); } # [end] # SAVE NEW HTML The first line ( .wrap() ) I could easily do with a find and replace, but it gets tricky when I have to determine the calculated height of an element, which can't be