addEventListenerin
addEventListenerin is a JavaScript method used to attach an event handler to an element. It allows you to specify the type of event you want to listen for and the function that should be executed when that event occurs. This is the standard and recommended way to handle events in modern web development, replacing older methods like `onevent` properties.
The basic syntax involves calling `addEventListenerin` on the target element. The first argument is a string
For example, to make a button change its text when clicked, you would select the button element,