Update index.md (#36571)

* Update index.md

update jQuery events method article

* Update guide/english/jquery/jquery-event-method/index.md

Co-Authored-By: Randell Dawson <5313213+RandellDawson@users.noreply.github.com>
pull/31432/head^2
amytsao 2019-08-07 12:58:39 -07:00 committed by Randell Dawson
parent ae6e261068
commit e365cd0d2d
1 changed files with 15 additions and 2 deletions

View File

@ -3,8 +3,21 @@ title: jquery Event Method
---
## jquery Event Method
These methods are used to register behaviors to take effect when the user interacts with the browser, and to further manipulate those registered behaviors.
These methods are used to register behaviors to take effect when the user interacts with the browser, and to further manipulate those registered behaviors. Some examples of this would be when a user clicks on a button or moves their mouse. When these events are triggered, a custom function can be called to do whatever you want.
Most DOM events have an equivalent jQuery method, such as `.click()`, `.focus()`, etc.
An example of assigning an event to an element:
```js
$("button").click(function() {
alert("You clicked me!");
});
```
In this example, an alert box appears once any button on the page is clicked.
The most commonly used jQuery event method is `$(document).ready()`. This allows the user to execute a function when the document is fully loaded.
#### More Information:
<!-- Please add any articles you think might be helpful to read before writing the article -->
https://api.jquery.com/category/events/
https://api.jquery.com/category/events/