View Single Post
Old 10-05-2007, 04:19 AM   #9 (permalink)
Costin Trifan
v7n Mentor
 
Costin Trifan's Avatar
 
Join Date: 04-13-07
Location: Romania
Posts: 2,963
iTrader: 0 / 0%
Latest Blog:
Ok, so we're back

Costin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web pro
One more thing:

Quote:
document.getElementById('li')[0].setAttribute('id','currentID');
^^ That is not right. I mean when using getElementById the returned value will be a single element, found by the requested ID.

The way you use getElementById is wrong, because you ask for an Array:
getElementById('li')[0]. to access the first element in the Array...

You have to do like this:
Quote:
document.getElementsByTagName('li')[0].setAttribute('id', 'currentID');
Costin Trifan is offline   Reply With Quote