Added code block for .on("click") description (#27126)

pull/26913/merge
agrygo 2019-03-21 07:22:30 -06:00 committed by The Coding Aviator
parent 70841e6497
commit 1577bfd8c2
1 changed files with 1 additions and 1 deletions

View File

@ -75,7 +75,7 @@ $("#alert").click();
Now, whenever the page loads, the click event will be triggered when we enter or reload the page, and show the assigned alert.
Also you should prefer to use .on('click',...) over .click(...) because the former can use less memory and work for dynamically added elements.
Also you should prefer to use ```.on("click",...)``` over ```.click(...)``` because the former can use less memory and work for dynamically added elements.
<a href='https://jsfiddle.net/gspk6gxt/' target='_blank' rel='nofollow'>jsFiddle</a>