I have created a small jquery selector help which is optimized for the advanced iframes scenarios. It is an extract from http://refcardz.dzone.com/refcardz/jquery-selectors#refcard-download-social-buttons-display. So please go there if you need an extended version or give someone credit.
jQuery selectors are one of the most important aspects of the jQuery library. These selectors use familiar CSS syntax to allow page authors to quickly and easily identify any set of page elements to operate upon with the jQuery library methods. Understanding jQuery selectors is the key to using the jQuery library most effectively. The selector is a string expression that identifies the set of DOM elements that will be collected into a matched set to be operated upon by the jQuery methods.
There are three categories of jQuery selectors: Basic CSS selectors, Positional selectors, and Custom jQuery selectors.
The Basic Selectors are known as "find selectors" as they are used to find elements within the DOM. The Positional and Custom Selectors are "filter selectors" as they filter a set of elements (which defaults to the entire set of elements in the DOM). This extract will focus on the basic selectors as they are most important and will cover most of your needs.
These selectors follow standard CSS3 syntax and semantics. For more selectors and examples go to http://api.jquery.com//category/selectors.
| Syntax | Description |
|---|---|
| * | Matches any element. |
| E | Matches all elements with tag name E. |
| E F | Matches all elements with tag name F that are descendants of E. |
| E>F | Use E##F. ## is converted to >. Matches all elements with tag name F that are direct children of E. |
| E+F | Matches all elements with tag name F that are immediately preceded by a sibling of tag name E. |
| E~F | Matches all elements with tag name F that are preceded by any sibling of tag name E. |
| E.c | Matches all elements E that possess a class name of c. Omitting E is identical to *.c. |
| E#i | Matches all elements E that possess an id value of i. Omitting E is identical to *#i. |
| E[a] | Matches all elements E that posses an attribute a of any value. |
| E[a=v] | Matches all elements E that posses an attribute a whose value is exactly v. |
| E[a^=v] | Matches all elements E that posses an attribute a whose value starts with v. |
| E[a$=v] | Matches all elements E that posses an attribute a whose value ends with v. |
| E[a*=v] | Matches all elements E that posses an attribute a whose value contains v. |
These selectors are basic filters provided by jQuery I found useful using in this plugin. For more selectors and examples go to http://api.jquery.com//category/selectors.
| E:not(selector) | Remove elements from the set of matched elements. |
| E:eq(index) | Select the element at index n within the matched set. |
| E:last() | Selects the last matched element. |
| E:nth-child(index) | Selects all elements that are the nth-child of their parent. |
You can create the union of multiple disparate selectors by listing them, separated by commas. For example, the following matches all <div> and <p> elements: div,p
Please go to the jQuery API http://api.jquery.com/category/selectors/ for the official documentation.
The advanced iframe pro version has an included jQuery help with examples.
', 'advanced-iframe'); } ?>