innerHTML VS W3C DOM

Several people have pointed to the battle between innerHTML and W3C DOM methods (createElement) today.

The Web Standard Project points to DomBuilder which it calls an "elegant lightweight script". DomBuilder lets you build a DOM without using document.createElement, setAttribute calls, and loads of code which can make your code really hard to understand. Instead you do something like:

P({ 'class' : 'warning' },  // if you are specifying a class attribute quote it..it's a reserved word  STRONG("WARNING:"), " I am extremely lazy.");

Still, innerHTML is a ton faster than W3C DOM. 

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>