jQuery methods and use

jQuery content:

  1. Selector
  2. Filters
  3. Style operations
  4. Text manipulation
  5. Property operations
  6. Document processing
  7. event
  8. Animation
  9. Plug
  10. each、data、Ajax

 

The remaining unwritten include:

1, the form filters:

:text
:password
:file
:radio
:checkbox
:submit
:reset
:button

 

 example:

$ ( ": Checkbox") // Find all checkbox
<! DOCTYPE HTML > 
< HTML lang = "EN" > 
< head > 
    < Meta charset = "UTF-. 8" > 
    < title > the Title </ title > 
    < Script the src = "the jQuery-3.4.1.js" > </ Script > 
</ head > 
< body > 
<-! novalidate tell the browser not to help you make extra data verification -> 
< from Action = "" > 
    < the p- > <label for="d1">username:<input type="text" id="d1" disabled></label></p>
    <p><label for="d2">password:<input type="password" id="d2"></label></p>
    <input type="submit">
    <input type="checkbox" name="hobby">of the typethe INPUT<Basketball
    ="checkbox" name="hobby" checked>台球
    <input type="checkbox" name="hobby">足球

    <select name="" id="">
        <option value="">111</option>
        <option value="" selected>>222</option>
        <option value="">333</option>
    </select>
</from>
</body>
</html>

 

2, the form object properties

:enabled
:disabled
:checked
:selected

3, the filter method

  The next element

$("#id").next()
$("#id").nextAll()
$("#id").nextUntil("#i2")

 Previous element

$("#id").prev()
$("#id").prevAll()
$("#id").prevUntil("#i2")

  Father element

$ ( "# the above mentioned id"). parent () 
$ ( "# the above mentioned id"). Parents () // Find the current element of all fathers elements 
$ ( "# id"). parentsUntil () // Find the current element of all fathers elements until it encounters an element that matches so far.

  Son and siblings

$ ( "# id") children ();. // sons 
. $ ( "#id") siblings () // brothers

 

  Seek

$ ( "div"). filter ( ". c") // concentrate was filtered out from the results there is a style class c1 
is equivalent to $ ( "div.c1")

 supplement:

.first () // get the first element that matches 
.last () // get the last element that matches 
.not () // delete from the set of matched elements in the specified expression matching elements 
.has () / / retention element contains a particular offspring, containing the specified element does not remove those offspring. 
.eq () // index value is equal to the specified value of the element

 

 4, the left menu

 

  

  

 

Guess you like

Origin www.cnblogs.com/Gaimo/p/11503944.html