jquery animation ——. trim () remove spaces,. Get (), and. Index () to get DOM elements

Source: Internet
Author: User

. Trim () remove spaces,. Get (), and. Index () to get DOM elements

1 The . Trim () function is used to remove whitespace characters at both ends of a string, with no extra parameter usage

2 Remove all newline characters at the beginning and end of the string, spaces (including contiguous spaces) and tabs (tab), if they are in the middle of the string, they will be preserved and not removed
3. Get () gets the DOM element and finds the corresponding element in the collection through a known index
4 Get gets the DOM object, the object obtained through document.getElementById, the index starting from 0, as found in the second element, can be passed $ (a). Get (1)
5 common syntax. get ([index])
6 The negative index value parameter is a backward index, passing a negative index value, and a negative index starting value of 1, as
The second element is found and can be passed $ (a). Get (-2)

7 . Index () Searches for the index value of a given element from a matching element, counting from 0, parameter accepts a jquery or Dom object as a condition for finding

8 Common syntax
. index () an element of the same level whether it is a homogeneous Li element including a starting from the first child element of the parent element
. Index (selector selector) 2 and 3 are calculated from the element (LI) index 0 to be found, and the other child element indexes (such as a) of the parent element that are not Li are ignored and the index is not evaluated
. Index (element elements)
9 If you do not pass any arguments to the. Index () method, the return value is the position of the first element in the jquery object relative to its sibling element
10 if the. Index () is called on a set of elements, and the parameter is a DOM element or a jquery object, the. Index () return value is the position of the passed-in element relative to the original collection
11 If the parameter is a selector, the. index () return value is the position of the original element relative to the selector match element. If no matching element is found, then. Index () returns-1

jquery animation ——. trim () remove spaces,. Get (), and. Index () to get DOM elements

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.