user image

Gagan Mishra

Job Interview Skills
English
2 years ago

Question 649. Where Do You Add An Event Handler?

user image

Abhishek Mishra

2 years ago

To add an event handler to an event of an element, you use the addEventListener() method of the element object: element.addEventListener(type,eventListener); ... <button class="btn">Subscribe</button> ... function clickHandler(event) { console.log('Button Clicked'); }

Recent Doubts

Close [x]