Selectors
All Selector (”*”)
Select all elements
$("*")
Class Selector (”.class”)
Selects all elements with the given class.
$(".class")
ID Selector (”#id”)
Selects a element with the given id.
$("#id")
Attribute Equals Selector [name=”value”]
Selects elements that have the specified attribute with a value exactly equal to a certain value.
$("[name='value']")
Has Attribute Selector [name]
Selects elements that have the specified attribute, with any value.
$("[name]")
:eq() Selector
Select the element at index n within the matched set.
$(".class:eq(index)")
:gt() Selector
Select all elements at an index greater than index within the matched set.
$(".class:gt(index)")
:lt() Selector
Select all elements at an index less than index within the matched set.
$(".class:lt(index)")
:odd Selector
Selects odd elements, zero-indexed.
$(".class:odd")
:even Selector
Selects even elements, zero-indexed.
$(".class:even")