jQuery bind: Main Tips
- The jQuery
.bind()
method has been deprecated since version 3.0 of jQuery. Use .on() method instead. .bind()
added event handlers to the selected elements.
How .bind() Worked
The jQuery .bind()
method was used to attach event handlers to elements.
jQuery .bind()
followed this syntax:
$("selector").bind(event, data, function);
There were three parameters relevant to jQuery .bind()
:
event
defined a standard JavaScript event or a customjQuery.event
object.data
represented the additional data to be passed to the handler function.function
specified the handler function to attach and run when the specified event was triggered.
Note: .bind() added handlers directly to selected elements. Therefore, the elements had to be present when the function occured. For more flexibility, .on() was used.
Latest Udacity Coupon Found:
Verified STAFF PICK
75% OFF COURSES
Udacity Black Friday Offer
The best time to save on Udacity courses is now - follow this coupon to access a 75% Udacity Black Friday discount & enjoy learning at a very low cost!
Expiration date: 18/01/2021
3176 People Used
Only 97 Left