2 IDs for getElementById?
Basically I need to add a second ID to getElementById
to get around this, I've just copied the entire js and changed the ID and pasted it at the end of the file. I'm sure there is a better way to do this.
This is the section I need to change the 'site-navigation' part, I need it to also include 'lower-navigation'
Here is the full .js file http://pastebin.com/PmAsjUg7
var button = document.getElementById( 'site-navigation' ).getElementsByTagName( 'h3' ),
menu = document.getElementById( 'site-navigation' ).getElementsByTagName( 'ul' );
The ID attribute for elements is meant to be a unique identifier. Because of that the getElementById() method can only ever return one value. If you of course have duplicate ID values it will cause an error.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread