I am curious if there is an existing javascript framework that allows you to more easily create DOM in javascript.
Currently, I am changing the DOM like this:
var header_field = document.createElement('h1');
header_field.className = "header";
header_field.innerHTML = "This is the header";
parent_dom.appendChild(header_field);
... as an example.
Is there a framework that will say, interpret a javascript object, and manipulate the DOM based on that? I kind of envision something like:
jQuery.createDOM(
[
{ element : 'h2', text : "This is the header", class : "header" }
]
);
... or something of that style.
For complex Ajax-Driven sites, I find myself typing a lot of repetitive code in order to create otherwise simple HTML. So, is there a framework out there that makes the process of manipulating the DOM in javascript considerably easier? Does jQuery already offer this and I just haven't heard of it?