diff --git a/guide/english/jquery/jquery-click-method/index.md b/guide/english/jquery/jquery-click-method/index.md index b4ba01a00e..45bad66390 100644 --- a/guide/english/jquery/jquery-click-method/index.md +++ b/guide/english/jquery/jquery-click-method/index.md @@ -5,6 +5,7 @@ title: Click Method # Click Method + The jQuery Click method triggers a function when an element is clicked. The function is known as a "handler" because it handles the click event. Functions can impact the HTML element that is bound to the click using the jQuery Click method, or they can change something else entirely. The most-used form is: @@ -80,13 +81,13 @@ Also you should prefer to use .on('click',...) over .click(...) because the form #### Common Mistakes -The click event is only bound to elements currently on the DOM at the time of binding, so any elements added afterwards will not be bound. To bind all -elements on the DOM, even if they will be created at a later time, use the `.on()` method. +The click event is only bound to elements currently in the DOM at the time of binding, so any elements added afterwards will not be bound. To bind all +elements in the DOM, even if they will be created at a later time, use the `.on()` method. For example, this click method example: ```javascript -$( "element" ).click(function() { +$("element").click(function() { alert("I've been clicked!"); }); ``` @@ -94,7 +95,7 @@ $( "element" ).click(function() { Can be changed to this on method example: ```javascript -$( document ).on("click", "element", function() { +$(document).on("click", "element", function() { alert("I've been clicked!"); }); ```