Hi,
I am trying to get the content of an element and reuse it elsewhere in the script
lets say i have:
Ok so what i want to do, is tu reuse the code contained into the Element named "subcontainer".
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.getEle mentById("conte nt").innerHTML. selectedNode;[/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
I am trying to get the content of an element and reuse it elsewhere in the script
lets say i have:
Code:
<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.getEle mentById("conte nt").innerHTML. selectedNode;[/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
Comment