First, attribute filter
$ (' input[name] ') Select the element with the name attribute on all input labels on the page
$ (' input[name=xxx] ') selects all input tags on the page with the name attribute and the value equals XXX element
$ (' input[name! =XXX] ') selects all input tags on the page with the name attribute and the value is not equal to the element xxx
$ (' input[name^=x] ') Select all input tags on the page have the name attribute and the value is an element that begins with X
$ (' input[name$=x] ') Select all input tags on the page have the name attribute and the value is an element that ends with X
$ (' input[name*=x] ') Select all the input tags on the page have the name attribute and the value contains the element of X
$ (' input[name][value]: ') Selects all the input labels on the page that have the name attribute, the element of the Value property
$ (' Fome:d isabled ') Select all the disabled elements under the Form tab, notice that there is a space behind the Fome
$ (' fome:enabled ') Select all elements that are not disabled under the Form tab, note that there is a space behind the Fome
$ (': CHECKD ') Select all elements on the page that are checked true and do not include selected:checked to select all selected radio and checkboxes
$ (': Selected ') Select all elements on the page that are selected true: Selected represents all selected select elements
Second, form selector
$ (': input ') Check all labels in the form, including input TEXTAREA radio checkbox Select button
Equivalent to $ (' Input,radio,checkbox ... ')
$ (': Text ') indicates that all single-line text boxes are selected. Equivalent to $ (' input[type=text] ')
$ (': CheckBox ')
$ (': Radio ')
The same as ': Tag type ' is the element that selects the corresponding form in the page
$ (' a '). attr (' href ', ' http://www.baidu.com '); means to get a label on the page and assign a value to its href attribute
$ (' a '). removeattr (' href ') removing the href attribute
Iii. jquery Dynamic creation of an object
var alink=$ (' <a href= ' ... ' title= ' dfdfdbsdk ' > Baidu </a> '); Create an Object
Alink.attr (' Tagert ', ' _blank ') Add attributes to this object
$ (' div '). Append (ALink); Add to a layer
$ (' <input/> '). AppendTo (' #div ') means creating an element and appending the element to the layer with the ID #div.
Iv. Emptys and remove
A.emptys () means emptying all child elements under an element without their own
A.remove () means that deleting the current element contains all the child elements under the element Remova has a return value,
The return value is the removed element that contains the removed child element
It is not necessary to delete the element when it is moved on the page, move it directly (Append, AppendTo),
Because an element in the DOM can have only one parent node
Chila jquery Selector < 21 >