drbigfresh Posted April 18, 2007 Share Posted April 18, 2007 I have a list item menu like below, and I am trying to find some JavaScript so that on each page I can dynamically change (I guess when the page loads) the id of the <li> from 'itemone' or 'itemtwo' to 'active' ...Can anyone point me in the right direction.... Thanks! <div id="navcontainer"> <ul id="navlist"> <li id="itemone"><a href="#" id="current">Item one</a></li> <li id="itemtwo"><a href="#">Item two</a></li> <li id="itemthree"><a href="#">Item three</a></li> </ul> </div> Link to comment https://forums.phpfreaks.com/topic/47500-changing-id-of-li/ Share on other sites More sharing options...
nogray Posted April 18, 2007 Share Posted April 18, 2007 just use something like this document.getElementById('itemone').id = "active"; Link to comment https://forums.phpfreaks.com/topic/47500-changing-id-of-li/#findComment-232375 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.