advanced j query selectors

15

Upload: matheus-danemberg

Post on 15-Jun-2015

723 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Advanced j query selectors
Page 2: Advanced j query selectors
Page 3: Advanced j query selectors

01

$('[attribute|="value"]')

Description: Selects elements that have the specified attribute with a value either equal to a given string or starting with that string followed by a hyphen (-).

Example

$('[attribute*="value"]')

Description: Selects elements that have the specified attribute with a value containing the a given substring.

Example

Page 4: Advanced j query selectors

02

$('[attribute^="value"]')

Description: Selects elements that have the specified attribute with a value beginning exactly with a given string.

Example

$('[attribute$="value"]')

Description: Selects elements that have the specified attribute with a value ending exactly with a given string. The comparison is case sensitive.

Example

Page 5: Advanced j query selectors

03

$('[attribute!="value"]')

Description: Select elements that either don't have the specified attribute, or do have the specified attribute but not with a certain value.

Example

Page 6: Advanced j query selectors

04

$(':visible')

Description: Selects all elements that are visible.

Example

$(':checked')

Description: Matches all elements that are checked.

Example

Page 7: Advanced j query selectors

05

$(':eq(index)')

Description: Select the element at index n within the matched set.

Example

$(':nth-child(index/even/odd/equation)')

Description: Selects all elements that are the nth-child of their parent.

Example

Page 8: Advanced j query selectors

06

$(':even')

Description: Selects even elements, zero-indexed.

Example

$(':odd')

Description: Selects odd elements, zero-indexed. See also even.

Example

Page 9: Advanced j query selectors

07

$(':first-child')

Description: Selects all elements that are the first child of their parent.

Example

$(':last-child')

Description: Selects all elements that are the last child of their parent.

Example

Page 10: Advanced j query selectors

08

$(':first')

Description: Selects the first matched element..

Example

$(':last')

Description: Selects the lastmatched element..

Example

Page 11: Advanced j query selectors

09

$(':gt(index)')

Description: Select all elements at an index greater than index within the matched set.

Example

$(':lt(index)')

Description: Select all elements at an index less than index within the matched set.

Example

Page 12: Advanced j query selectors

10

$(':not(selector)')

Description: Selects all elements that do not match the given selector.

Example

$(':has(selector)')

Description: Selects elements which contain at least one element that matches the specified selector.

Example

Page 13: Advanced j query selectors

11

$(':parent')

Description: Select all elements that are the parent of another element, including text nodes.

Example

Page 14: Advanced j query selectors

12

$(':header')

Description: Selects all elements that are headers, like h1, h2, h3 and so on.

Example

Next Adjacent Selector (“prev + next”)Description: Selects elements which contain at least one element that matches the specified selector.

Example

Page 15: Advanced j query selectors

13

JQuery selectors documentationAll JQuery selectors and examples can be found on this link.

http://api.jquery.com/category/selectors/

Thank You. :)