Look into DOM manipulation methods. A few you might find useful:
Quote:
document.createElement(string)
document.createTextNode(string)
node.cloneNode(bool)
node.appendChild(node)
node.insertBefore(node, node)
node.removeChild(node)
node.replaceChild(node, node)
|
This is a short list from the (highly recommended) book
Beginning JavaScript with DOM Scripting and Ajax by Christian Heilmann. I posted it because I have yet to find such a concise yet useful list of such functions online.
DOM manipulation can be tricky because some browsers, such as FireFox, insert text nodes between elements while others, such as IE, do not. Utilizing the Firebug plug-in for Firefox will make your life easier.
You might also find
this useful.