What are the basic operations of jQuery
This article is to share with you about the basic operation of jQuery. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
1. Selector
1.1.id selector
$('# id')
1.2.class selector
$('.cl')
1.3. Tag selector
$('div')
1.4 combination selector
1 2 3 $('# i1men.c1flore a') # i1 and .c1 and all tags of a
1.5. Hierarchical selector
1 2 3 $('# i1.c1 a') # i1 all a tags under .c1 (including future generations) $('# i1.c1 > a') # i1 all a tags under .c1 (only sons)
1.6. Basic
: the first a tag under .c1 under first $('# i1 .c1 an a:eq first') # i1: the last a tag under .c1 under last $('# i1 .c1 apura last') # i1: the last a tag under .c1: eq () $('# i1 .c1 a:eq (1)') # i1 under .c1
1.7. Attribute
$('[name]') all tags with the name attribute $('[name= "user"]') the name attribute equals the tag of user
1.8. Filter
$('i1'). Next () # next $(' i1'). Prev () # previous $('i1'). Parent () # parent tag $(' i1'). Children () # Child tag $('i1'). Siblings () # Brother tag
two。 Operation example
Add address Port Operation 1.1.1.11 80 Edit | Delete 1.1.1.12 80 Edit | Delete 1.1.1.13 80 Edit | Delete
Operation
Address:
Port: