jquery element get

Source: Internet
Author: User

Preface: This is the category of the blog, jquery is the beginning of the search. Because checking the manual is too cumbersome, and sometimes you need to drill down into the detail page of the command to see what the purpose of this command is. Write this article is to, work encountered problems, a look at these articles can find out which command is exactly in line with the role, and then go into the manual for specific learning usage. The writing is often used, provided you have a certain understanding of the jquery command and a jquery handbook. Chapter One: jquery elements get common usage1, using the tag name to get the element $ ("Label name")2, gets the element by ID $ ("#id_name")3, gets the element through the class name $ (". ClassName")4, get multiple elements at once $ ("element name, element name, element name ....")5, gets the element by specifying a hierarchy relationship $ ("Descendants of Ancestors")$("Parent > Child")$("Front + rear")$("Brother ~ Brother")6, gets the element based on the attribute value of the element [Attribute][attribute=value] [Attribute!=value] [Attribute^=value] [Attribute $=value] [Attribute*=value]7, gets the element through the filter $ ("element name: Filter") filter List: First:last:not (filter): Even:odd:eq (Index): LT (index): GT (Index): header:animated:contains (text): Empty: Has (selector):p arent "Note: This is to get a non-empty element that is not a parent element"8, gets the form element $ (": Form Filter Name"method to get form elements: Input:text:password:radio:checkbox:submit:image:reset:button:file "NOTE: The form label is also a label, you can also use the tag name to get, However, some types of labels can be differentiated by filters. such as: $ ("Input:text") "9, gets the form element through the filter: Enable gets the element that can enter the state: Disabled gets the element that cannot be entered:checkedgets the element of the selected element: Selected gets the element selected in the drop-down boxTen, gets the element from the collection element by specifying the ordinal number ("element name"). EQ (index) One, gets the element that matches the specified condition $ ("element name"). Filter (expr) A, gets the element of the specified range $ ("element name"). Slice (Start,[end]) -, gets the element that is consistent with the conditional expression $ ("element name"). is(expr) -, gets the next element of the element $ ("element name"). Next ([expr]) the, gets the previous element of the element $ ("element name"). Prev ([expr]) -, gets the parent element of the element $ ("element name"). Parent ([expr]) -, gets the element's child element $ ("element name"). Children ([expr])

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.