HTML:
JQuery: ('.nameClass').click(myFunction); or ('#txtName').click(myFunction);
In Jquery Which is best perform when we have 100's of control to apply this logic. And Why better perform ?
HTML:
JQuery: ('.nameClass').click(myFunction); or ('#txtName').click(myFunction);
In Jquery Which is best perform when we have 100's of control to apply this logic. And Why better perform ?
Using id selector will be fast always as it returns single element but class selector will return one or more elements.
NOTE - You must ensure that id should be unique through out the DOM.