Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

addeventlistener to button javascript

const button = document.getElementById('yourButton');
button.addEventListener('click', (event) => {
	// Do something with the event
    // https://developer.mozilla.org/en-US/docs/Web/API/Event
})
 
PREVIOUS NEXT
Tagged: #addeventlistener #button #javascript
ADD COMMENT
Topic
Name
7+1 =