Jquery css selector learning Notes

Source: Internet
Author: User

1. $ ('node + next') =$ ('node'). next ()

2. $ ('node ~ Siblings ') = $ ('node'). nextAll ();

3.: the element whose gt (index) is greater than the index number, starting from 0.

4.: the element whose index is smaller than the index number, starting from 0.

4.: The header obtains all elements of h1, h2, h3, h4...

Example

For example, you want to obtain the z-index value of the div with id 123

$ ("#123" ).css ("z-index ")

This is what you want to set the attribute value.

$ ("#123" ).css ("z-index", "10 ")

Let's sum up.

JQuery has several methods for CSS operations

AddClass ()-Add one or more classes to the selected element
RemoveClass ()-delete one or more classes from the selected element
ToggleClass ()-adds or deletes the selected element to/from the switch operation.
Css ()-set or return style attributes

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.