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');
|