How does js add a click event to each li?
This article mainly explains "how to add a click event for each li by js". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how js can add a click event to each li.
This is the first li, this is the second li, this is the third li.
Answer 1: bind, point the current anonymous function to this and pass in I as a parameter
Var init = function () {var obj = document.getElementById ('text'); for (var iTuno