jquery Learning Notes

Source: Internet
Author: User

Reprint please specify the original address:

One: what does jquery do?

jquery is a library of JavaScript functions. We know that JS is a scripting language that runs in the browser and can implement dynamic control of the Page. however, The native JS is relatively simple, and the amount of code required to implement complex functions is considerable. thus, a series of JS function libraries are Born. Among them, jquery is the most popular JS function library, which encapsulates a lot of complex and useful functions, we call directly.

Features of the jquery library:

    • HTML element Selection
    • HTML element manipulation
    • CSS actions
    • HTML Event functions
    • JavaScript Effects and animations
    • HTML DOM Traversal and modification
    • Ajax Asynchronous programming
    • Plug-in mechanism to extend functionality (introduce certain domain specific plug-in tools, such as: banking system security detection plug-in, Etc.)

Ii: the introduction of jquery

jquery is selected by the $ () object and then by The. function name () call method。

four: jquery selector: Selecting page elements

1: the basic selector jQuery selector can be passed through the Element'sid, class, type, attribute, Property valueAnd so on select HTML Elements. 1) element Selector: Select by element name: $ ("name") 2) #id selector: The ID of the element on the page should be unique, so selecting a unique element in the page requires a #id selector: $ ("#id") 3) class Selector: finds the element by the specified class: $ (".    Class name ") 2: hierarchical selectors can be carefully selected from a large to a small level. 1) ancestor descendant selector: the front large selector, followed by the smaller element selector in the previous selector result:$("大元素 小元素")2) Parent-child selector:$("父元素 > 子元素")3) next to selector: the second selector element immediately following the first selector:$("前 + 后")4) range selector: All target elements after the Prev element:$("prev ~target")3: Filter 1) the first one:$(‘范围元素:first‘)2) non-:$("范围元素:not(选择器)")3) even Items:$("范围元素:even")4) Odd Items:$("范围元素:odd")5) section i-1 (starting from 0):$("范围元素:eq(i)")6) Greater than i-1:$("范围元素:gt(i)")7) last Item:$(‘范围:last‘)8) less than i-1:$("范围:lt(i)")9) the root of the document: $ (": Root") 4: content selector 1) contains elements of a content:$("范围元素:contains(‘内容‘)")2) Find Empty Elements:$("范围:empty")3) the element that contains the content of a selector:$("范围:has(选择器)")4) find the element that contains the child elements:$("范围:parent")5: Property Selector 1) Find the element that contains a property:$("范围[属性]")2) find the element with the attribute as a value:$("范围[属性=‘值‘]")Also: not equal to a property value, a property value starts with something, a property value ends with a certain content, a selector consists of multiple attribute conditions, and so On. 6: form Selector form selector format: $ (": Tag Name") main
    • : input
    • : Text
    • :p Assword
    • : Radio
    • : checkbox
    • : Submit
    • : Image
    • : RESET
    • : button
    • : File

7: Form Property Selector

There are two commonly used:

1) match All selected selected elements (checkboxes, radio boxes, etc.):$("input:checked")

2) match all of the selected option Elements:$("select option:selected")

jquery Learning Notes

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.