Home >Web Front-end >JS Tutorial >What are the jquery selection methods_jquery

What are the jquery selection methods_jquery

WBOY
WBOYOriginal
2016-05-16 16:47:471194browse

1. Select the jQuery object:

first() last() eq() slice() filter() not() has() add()

2. Will select the element set Used as context:

find() (descendant elements)

children() (direct child elements)

contain() (direct child elements, including text nodes, No parameters)

next()(next)

prev()(previous)

nextAll()(all following)

prevAll( )(All before)
nextUntil()(Find the next sibling elements until the selector element is matched, no selector is the same as nextAll())
prevUntil()(Find the previous sibling elements until the selector element is matched, No selector is the same as prevAll())
siblings() (all sibling elements)
parent() (direct parent element)
parents() (all ancestor elements upward)
parentsUntil() (Find all ancestor elements up to the matching selector element. No selector is the same as parents())

closest() (The closest ancestor element matching the selector must be passed in the selector parameter)

3. Restore to the previous selected element set

end() (pop the stack)

If you want to manually define the selected element set while maintaining compatibility with the end() method:

pushStack() (parameter is array) (Which functions have pushStack operations inside, find, slice, map, not, filter, closest, add, before, after, replaceWith, append and other add operations)

andSelf() merges the previously selected elements

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn