Basic question.
document.getElementById("yy").onmouseover = hi; //document.getElementsByTagName("li").onmouseover = hi; ... In this example, http://jsfiddle.net/8fURz/1/ why does the first line work, but not the second line (when it is un-commented, of course)?
I know I can do this easily with jQuery, just wonderin...
.getElementsByTagName()returns an array of objects, while.getElementById()returns an object, so you have to select a specific index with the former, but not the latter (since it's single by nature).