absolutezero
12-15-2008, 06:54 AM
function GenerateItembarLinks()
{
itembar = document.getElementById('itembar')
items = document.getElementsByTagName('h2')
for (var i=0; i<items.length; i++)
{
itembar.innerHTML = items[i].innerHTML
}
}
Thats my code so far. It's purpose is to get all the links inside h2 headers in the "main content" section of my website and copy them to a bar at the top of my site. Although this code seems to copy only the last link. I'm still sort of new to javascript BTW... Any ideas?
{
itembar = document.getElementById('itembar')
items = document.getElementsByTagName('h2')
for (var i=0; i<items.length; i++)
{
itembar.innerHTML = items[i].innerHTML
}
}
Thats my code so far. It's purpose is to get all the links inside h2 headers in the "main content" section of my website and copy them to a bar at the top of my site. Although this code seems to copy only the last link. I'm still sort of new to javascript BTW... Any ideas?