View Single Post
Old Oct 2nd, 2007, 12:32 AM   #3
titaniumdecoy
Expert Programmer
 
titaniumdecoy's Avatar
 
Join Date: Nov 2005
Posts: 837
Rep Power: 3 titaniumdecoy is on a distinguished road
Send a message via AIM to titaniumdecoy
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.
titaniumdecoy is offline   Reply With Quote