I\'m building a web application (using prototype) that requires the addition of large chunks of HTML into the DOM. Most of these are rows that contain elements with all man
You do it using a good way, and that's pretty fast considering other manners.
An alternate, supposely clean solution is to build in javascript the DOM elements you are to use, by calling several
document.createElement(tagName);
But your code will rapidly grow, in my thought, for nothing.
Another one, my favorite way to achieve DOM creation, is to place inside the HTML body the code you want to copy, give it a className and / or an id like "template" which will additionally ( using css ) hide it, and then process it as needed on event by getting the element back, cloning it, and setting property you want before appending where it belongs