<body> <ul> <li>1</li> <li>2</li> <li>3</li> </ul> <script> var lis=document.getElementsByTagName('li') for(var i=0;i<lis.length;i++){ lis[i].onclick=fn; } function fn(){ setInterval(function(){ console.log(this.innerText) }.bind(this),1000) } </script> </body>