![]() |
Changing table cell contents using DHTML
Hi. I hope it's not too presumptuous of me to ask for help in just my second post, but I'm having a little problem here and my understanding of the JavaScript DOM is spotty at best.
What I'm trying to do is have a 2-cell horizontally laid out table that functions thus: The left-hand cell contains an unordered list of links and the right cell contains HTML-formatted content consisting of a single image and some wrapped text. Clicking one of a list of hyperlinks in a left-hand table cell triggers changes to the contents of the right-hand cell. Is there a way to store the HTML for the content cell into a string variable or an array, and then to write the appropriate variable's contents into the right-hand cell when clicking each link? Or maybe just place the html right into the <a> tag for each list item? |
OK I got it to work in IE 6 but not in Firefox.
Here's what I've got so far: :
|
Look into DOM manipulation methods. A few you might find useful:
Quote:
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. |
| All times are GMT -5. The time now is 2:11 PM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC