What does bind and unbind mean in jquery in idiot slow learner terms?
Binding: coupling an handler to an element(s), that will run when an event occurs on said element(s). Depending on what kind of event you want to handle you'd use different functions like click(function)
(alt: bind('click', function)
or focus(function)
(alt: bind('focus', function)
.
Unbinding: de-coupling of an handler from an element(s), so that when an event occurs the handler function will no longer run. Unbinding is always the same; unbind('click', function)
to unbind a certain handler, unbind('click')
to unbind ALL click handlers, and unbind()
to unbind ALL handlers. You can substitute click
for other types of events of course.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With