/ Published in: JavaScript
URL: http://jsfiddle.net/YwtEz/
Expand |
Embed | Plain Text
window.onload = function() { var ul = document.getElementById("foo"); var lis = ul.getElementsByTagName("li"); for(var i=0; i<lis.length; i++) { lis[i].onmouseover = function(x) { return function() { console.log(x); } }(i); } };
You need to login to post a comment.
