I am new to Jquery and in many examples and codes , I see event handlers are assigned dynamically using Jquery ( $(“#button”).click(somefunction) ) for HTML components even though they are statically created.
Is there any advantage of binding events dynamically to buttons that are created statically ?
I can get the advantage if the components are created dynamically ? Can some one please explain me.
Advantage you get is, it separate’s business logic from markup.