From e365cd0d2da3d78ffa04c962549257bfa7a3d6f2 Mon Sep 17 00:00:00 2001 From: amytsao Date: Wed, 7 Aug 2019 12:58:39 -0700 Subject: [PATCH] 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> --- .../english/jquery/jquery-event-method/index.md | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/guide/english/jquery/jquery-event-method/index.md b/guide/english/jquery/jquery-event-method/index.md index 65792ef5dc6..8f4528e452d 100644 --- a/guide/english/jquery/jquery-event-method/index.md +++ b/guide/english/jquery/jquery-event-method/index.md @@ -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: -https://api.jquery.com/category/events/ \ No newline at end of file +https://api.jquery.com/category/events/