Summary of common operation parts of jquery

Source: Internet
Author: User


Note: $ (". XXX") class, be sure to add points in front
Callback the name of the function to execute after completion
Hide Show: Hide () show ()
Fade: FadeIn () FadeOut () Fadetoggle ()
Opacity: FadeTo (speed,0.5)
Slide: Slidedown () Slideup () slidetoggle ("Slow" or 2000)
Animations: Animate ({left: "66px"}, "slow or fast" or 3000) milliseconds without quotation marks
Stop Animation Stop ()
callback function callback () has callbacks implemented after execution of the animation, none is implemented before animation

Get content
Text ()-Sets or returns the text content of the selected element
HTML ()-Sets or returns the contents of the selected element (including HTML tags)
Val ()-Sets or returns the value of a form field
Get Properties
attr () Gets the property value

Append ()-inserts content at the end of the selected element
Prepend ()-Inserts content at the beginning of the selected element
After ()-Inserts the content after the selected element
Before ()-insert content before selected element

Remove ()-Deletes the selected element (and its child elements)
Empty ()-Removes child elements from the selected element

AddClass ()-adds one or more classes to the selected element
Removeclass ()-deletes one or more classes from the selected element
Toggleclass ()-switch operation to add/Remove classes for selected elements
CSS ()-Set or return style properties

The parent () method returns the immediate parent element of the selected element parents () method returns all ancestor elements of the selected element, all the way up until the document's root element (
The Children () method returns all immediate child elements of the selected element the Find () method returns the descendant elements of the selected element, all the way down to the last descendant

The siblings () method returns all the sibling elements of the selected element next () method returns the next sibling element of the selected element Nextall () method returns all following sibling elements of the selected element
The Nextuntil () method returns all the following sibling elements between two given arguments

The first () method returns the initial element of the selected element

Summary of common operation parts of jquery

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.