i am trying to make it where my page im working on all the links can be added dynamically so when i need to change a link on the site i dont have to change EVERY page.Code:HTML CODE <div id="nav"> </div> JAVASCRIPT CODE function makeAutoLinks(){ contentEdit = document.getElementById("nav"); ul = document.createElement("ul"); li1 = document.createElement("li"); a1 = document.createElement("a"); a1.setattribute('href','index.html'); a1.appendChild(document.createTextNode('Home')); contentEdit.appendChild(ul); contentEdit.appendChild(li1); contentEdit.appendChild(a1); }
www.disasterexpertsinc.com
thats the site, the news bar on the right and the stuff under the nav bar is added dynamically, i want to add the links to, the code above dosent work.
please advise what im doing wrong.
-damasterjo




Reply With Quote