I am trying to get the content of an element and reuse it elsewhere in the script
lets say i have:
Expand|Select|Wrap|Line Numbers
- <div id="content">
- <ul name="subcontainer">
- <li name="header"><h3>Title</h3><h4>Text here...</h4></li>
- <li name="image"><img class="foto" src="3396/2.jpg"/></li>
- <li name="listcontent">Text Here...</li>
- <ol name="language">
- <li><img src="/images/es.gif" alt="es"/></li>
- </ol>
- </ul>
- <ul name="subcontainer">
- <li name="header"><h3>Title</h3><h4>Text here...</h4></li>
- <li name="image"><img class="foto" src="3396/2.jpg"/></li>
- <li name="listcontent">Text Here...</li>
- <ol name="language">
- <li><img src="/images/es.gif" alt="es"/></li>
- </ol>
- </ul>
- <div>
The point is that there are multiple of those. I am able to target the one that i need (in fact, it is the one that the user clicks on).
Once i have the <ul> element under a variable (named: selectedNode), i would like to be able to somwhere say:
[HTML]document.getElementById("content").innerHTML.selec tedNode;[/HTML]
The problem is that this will return an object, and will not print the content of the node, as i want it to do.
My question is,
Is there a way to access the selectedNode's content, assuming that the content is compound by multiple nodes and different levels of nodes?
thankyou very much
bili