window.onload = function () { var lis = document.getElementById("list").getElementsByTagName("li"); for (var i = 0; i < lis.length; i++) { lis[i].addEventListener('click', li_click, false); } } function li_click() { var that = this; console.log(that); var span = that.getElementsByTagName("span")[0]; console.log(span.innerText); }