I have the following code for a header:
<div id="title-text">
The Cuttlefisher Paradise
</div>
<div id="choices">
<ul>
<li id="home"><a href="#">Home</a></li>
<li id="contact"><a href="#">Contact</a></li>
<li id="about"><a href="#">About</a></li>
<!-- 5 more items -->
</ul>
</div>
I want this to be the header about 10 different web pages. I cannot use <frame> or <iframe> for graphical reasons.
For an example of what I want to do, I am currently using document.getElementById("home").setAttribute("class", "active") to style the active tab, but when the header (the block of code just above) is inserted into a div using innerHTML, document.getElementById does not work (returns null).
What simple method is there to either put the header (without <frame> or <iframe>) on multiple pages or get document.getElementById to find ids inserted with innerHTML?
createElement? I don't want to manually have to constuct the unordered list with lots of JavaScript. That sounds like it might end up being a very messy mix of HTML and JavaScript. @thirtydot : I preferably want to just use HTML, JavaScript, and CSS for this.