I'm reviewing a number of jQuery functions that have various implementations of id selection. I want to try and standardise on one best-practice approach, but before I do that I want to ensure that I pick the most efficient.
Does anyone have links to good articles (such as this one) that make comparisons between different types of selections in jQuery?
Specifically, I'm after comparisons like $("#id")
, $("#id[type=form_input_type]")
, $("#id .class")
and so on.
Actually, to be even more specific, my first priority is comparing:
$('input[id$="mySelectionID"]')
against
$('input:checkbox')
Both will return the same set of checkboxes. My gut feeling is that the second is faster, but I need to be sure.