-1

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 ?

1 Answers1

0

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.

Bhushan Kawadkar
  • 27,451
  • 5
  • 33
  • 55