What does event binding mean? I always come across this word whenever I search around the internet and whatever I try to look for the meaning, it’s still vague to me @_@
A while ago, while reading some blogs regarding JavaScript I see people using this sacred word that I cannot grasp.
What does event binding mean? I always come across this word whenever I search
Share
Event binding refers to telling the browser that a particular function should be called whenever some ‘event’ occurs. Events mostly relate to user input, such as clicks.
An example of binding to an event in jQuery can be the following:
This binds a function to
clickevent of DOM object with identifierelem. When user clicks it, an alert (message box) will be shown. Binding is done by invoking the jQuerybindfunction but there are other means to do that, (e.g. jQueryclickfunction in case of binding toclickevent).