Answers for "js create events in for always gets last id"

1

js create events in for always gets last id

button.addEventListener("click", function(index) {
      return function(){
        console.log(index)
      }
    }(i))
Posted by: Guest on October-14-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language