Computer Science, asked by hackxox, 1 year ago

what is the syntax of event listener in javascript

Answers

Answered by sanjeevkush71
1
The addEventListener() method allows you to add event listeners on any HTML DOM object such as HTML elements, the HTML document, the window object, or other objects that support events, like the xmlHttpRequest object.

hackxox: syntax plz
Answered by amritanshu6
2
element.addEventListener("click", myFunction);

function myFunction() {
    alert ("Hello World!");
}

PLEASE MARK MY ANSWER AS A BRAINLIEST ANSWER.
Similar questions