Mhtml
07-15-2003, 07:14 PM
How can I reuse the same id for elements and validate my code as xhtml strict?
Problem is that you can't redefine elements using the same id and my menu script I wrote uses the id to differ between a menu heading and it's child nodes.
Although you won't need my code I'll post it anyway.
<ol id="Menu">
<li id="menuTitle">Section</li>
<li><a href="#">Child node</a></li>
<li><a href="#">Child node</a></li>
<li><a href="#">Child node</a></li>
<li id="menuTitle">Section</li>
<li><a href="#">Child node</a></li>
<li><a href="#">Child node</a></li>
</ol>
The purpose is to be as clean as possible and keep javascript separate from the document. I only specify the menu and each section header and use dom to find child nodes of the sections which are really siblings.
Problem is that you can't redefine elements using the same id and my menu script I wrote uses the id to differ between a menu heading and it's child nodes.
Although you won't need my code I'll post it anyway.
<ol id="Menu">
<li id="menuTitle">Section</li>
<li><a href="#">Child node</a></li>
<li><a href="#">Child node</a></li>
<li><a href="#">Child node</a></li>
<li id="menuTitle">Section</li>
<li><a href="#">Child node</a></li>
<li><a href="#">Child node</a></li>
</ol>
The purpose is to be as clean as possible and keep javascript separate from the document. I only specify the menu and each section header and use dom to find child nodes of the sections which are really siblings.