Today in this story we will see about the functions of Event Listener in JavaScript. The addEventListener() method is used to setup called function when an specified event happens. So we will discuss briefly how to implement addEventListener() method in your code.
今天,在这个故事中,我们将了解JavaScript中事件监听器的功能。 当发生指定事件时, addEventListener()方法用于设置调用的函数。 因此,我们将简要讨论如何在您的代码中实现addEventListener()方法。
事件和事件处理程序的功能 (Functions of Event and Event handlers)
Events are nothing but it is an action which manipulates the page in the browser when the user performs any operations in it. They plays a vital role because they cause elements of webpages to change dynamically.
事件不过是什么,它是当用户在浏览器中执行任何操作时在浏览器中操纵页面的动作。 它们起着至关重要的作用,因为它们使网页的元素动态变化。
Let’s see an example so that you will understand.
让我们看一个例子,以便您理解。
The load event occurs when the browser finishes loading the document.
当浏览器完成文档加载时,发生加载事件。
The click event occurs when the user clicks the button in the webpage.
当用户单击网页中的按钮时,将发生单击事件。
There are many event can be happen either once or multiple times. You may not know e