Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the basic operations of jQuery

Shulou Source: shulou.com Published: 2022-06-03 04:10:34 11月15日 Update

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:

Tags: Tags attributes selections contents functions elements brothers titles foundations addresses instances methods more ports articles good practical sons only descendants Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Microsoft Xiaomi Shulou Tech Info Shulou Information