Transferred from: http://blog.csdn.net/woshisap/article/details/7341136
In an HTML document, the opening tag of an element usually contains multiple attributes (attribute), in jquery, in addition to the direct use of the ID and class attributes as selectors, it is also possible to select from a variety of attributes (such as title, etc.)
The element that is queried is filtered, and the attribute filter selector contains the brackets "[]" instead of a colon, usually using the "Selector [property filter selector]" syntax format, depending on whether the specified attribute is included or
Filters from the query to the element based on the property value.
1: Include attribute filter
Used to select all elements that contain a given property
Format: $ ("Selector[attribute]")
2: Attribute equals filter
Used to filter all elements of a given property equal to a particular value
$ ("selector[attribute=value]");
Example: $ ("input[name=accept]"). attr ("Checked", "true"); Select the check box with the name of accept
3: property contains filter
Used to select all elements of the specified property value containing the given string
Format: $ ("Selector[attribute*=value]")
Example: $ ("input[name*= ' News"). Val ("name contains the element with news"); Add a text value to the text box that contains ' news ' in name
4: attribute contains word filter
Lets you select elements in the specified property value that contain the given word (separated by spaces)
Format: $ ("selector[attribute~=value]");
Example: $ (' input[name~= ' News '). Val ("name contains the element of news word");
5: Attribute not equal to filter
Used to select all elements that do not contain a specified property, or that contain a specified property but that property does not equal a value
Format: $ ("Selector[attribute!=value]")
6: Property Start filter
Used to select all elements of a given property that begin with a specific value
Format: $ ("Selector[attribute^=value]")
7: End-of-property filter
Used to select all elements of a given property that end with a specific value
Format: $ ("Selector[attribute$=value]")
8: Composite Attribute Filter
Used to select all elements that meet multiple criteria at once
Format: $ ("Selector[selector1][selector2] ... [Selector[n] ")
Example: $ ("input[id][name^= ' News"). Val ("Compound condition"): Used to select a text box that contains an id attribute and the name value begins with ' News ' and set its value