Re: innerHTML mixes up HTML Attributes
There's no trolling involved -- just document reading and amendment using text manipulation rather than DOM manipulation. Text parsing and regexs become a lot simpler when you can be sure of case, and walking text (or a hybrid document, as you'd do with SAX) is a lot easier when things are in the expected order; setting semaphores and conditionals in a stream operation (examining the input linearly by character or token) almost requires it. It may be the wrong approach to take with an (x)HTML document, but it is a legitimate approach in a lot of parser-lexer implementations.
“Beware of bugs in the above code; I have only proved it correct, not tried it.” --Donald Knuth
"It was as if its architects were given a perfectly good hammer and gleefully replied, 'neat! With this hammer, we can build a tool that can pound in nails.'" -- Alex Papadimoulis (on TheDailyWTF.com)