Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

addEventListener to multiple events

var eventList = ["change", "keyup", "paste", "input", "propertychange", "..."];
for(event of eventList) {
    element.addEventListener(event, function() {
        // your function body...
        console.log("you inserted things by paste or typing etc.");
    });
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #addEventListener #multiple #events
ADD COMMENT
Topic
Name
6+8 =