0

I want to add multiple events on same functions because when user will fill form by himself either he can do direct keypress event or he can do onclick event. User can do anything so i want to add multiple events with my functions please help me to do that. I tried by myself but its not working.

editingArea.addEventListener("change", function(event){
    localStorage.setItem(KEY1,editingArea.value);
},false);

this is my function. i tried it with addEventListener("change keypress keydown", function(event) but it wont work for me.

amit sutar
  • 541
  • 2
  • 11
  • 37
  • Possible duplicate of [adding multiple event listeners to one element](https://stackoverflow.com/questions/11845678/adding-multiple-event-listeners-to-one-element) – caramba Dec 08 '17 at 09:52
  • If you're using JQuery you can use `.bind()` to apply multiple event listeners in seemingly one call, but in Plain JS you have to add them one by one. – George Dec 08 '17 at 09:53
  • 1
    Possible duplicate of [Binding multiple events to a listener (without JQuery)?](https://stackoverflow.com/questions/8796988/binding-multiple-events-to-a-listener-without-jquery) – George Dec 08 '17 at 09:53
  • i am using javascript – amit sutar Dec 08 '17 at 10:51

0 Answers0