What is the on() method in jQuery?
<button id="b">Click</button>
var n = 0;
$('#b').on('click', function () { n++; });
$('#b').click().click();
console.log(n);
Console output
2
See jQuery Events.
Learn more about the similar topics:
| Tutorials |
|---|
| No Content Found. |
| Exercises & Assignments |
|---|
| No Content Found. |
| Interview Questions & Answers |
|---|
| No Content Found. |