jquery has always liked it, it encapsulates JavaScript, it is more convenient to use, but no matter what method, it is necessary to understand the meaning of this method, in addition to the logic of their own clear, so as to achieve more results. "Encounter problems, read more manual" This sentence is the first time to learn scripting language when the teacher often said a word, the original very depressed him this sentence, but now found that the met
Selectors are the foundation of jquery, where event handling, traversal of the DOM, and AJAX operations all depend on selectors. Therefore, if you can use the selector skillfully, not only can simplify the code, but also achieve a multiplier effect. The jquery selector completely inherits the CSS style. The jquery selector makes it easy to find specific DOM eleme
must see, will have a great harvest, summed up too good:Http://www.cnblogs.com/xiaojinhe2/archive/2011/10/12/2208740.htmlHttp://www.cnblogs.com/tylerdonet/archive/2013/04/05/3000618.htmlHttp://www.cnblogs.com/Fooo/archive/2011/01/11/1932900.html2.Find (Expr|obj|ele)Official explanation:return value: JQueryOverviewSearches for all elements that match the specified expression. This function is a good way to find out the descendant elements of the element being processed.All searches are done usin
elements that match the specified expression. This function is a good way to find the descendant elements of the element being processed.
All searches rely on jquery expressions to complete them. This expression can be written using the Css1-3 selector syntax.
Parameters
Expr StringExpression used for lookupJQuery ObjectA jquery object for matching elementsElement domelementA DOM element
Example
Descr
JQuery has two options: Selector and filter. The filter further selects the jQuery object selected by the selector.
Children () is a filter. as its name implies, it is used to filter children that meet the criteria.
The complete f
Node operation methods such as each (), find (), and filter () in jQuery, jqueryfilter1. each (callback)
Official explanation:
Returned value: jQueryOverview
Execute a function using each matching element as the context.
This means that each time the passed function is executed, the this keyword in the function points to a different DOM element (each time it is a different matching element ). In addition, e
The difference between jquery's filter () function and find () function, jqueryfilter
The differences between jquery's filter () function and find () function:Many functions in jQuery are very convenient to use. At the same time, some functions are very close to each other, which may also cause some misoperations.The filter
jquery offers a lot of easy-to-use methods, and the jquery filter selector is one of them. The filter filters the required DOM elements primarily through specific filtering rules, using a colon (:) switch.First, basic filter: FirstSelect first element (single element)$ (' Li
The filter rules for content filters are primarily contained in child elements or text content.
$ (' Div:contains (' xxx ') '). CSS (' background ', ' #ccc '); Select element text node contains the element
$ (' div:empty ') of the xxx text. css (' background ', ' #ccc ');//Select Empty element
$ (' Ul:has (. red) '). CSS (' Background ', ' #ccc '); Select a child element containing the element
$ (':p arent ') of the class is red. CSS
Copy Code code as follows:
1. Simple Filter Selector: According to a certain type of filtering rules for element matching, write with a colon (:) beginning; Simple filter selector is the most widely used filter selector
jquery Selector Detailed
Depending on the elements in the obtained page, you can divide the
This example describes the use of the filter method in jquery. Share to everyone for your reference. The specific analysis is as follows:
The filter () method reduces the collection of matching elements to elements that match the specified selector.The parameters in the filter method can be string values and contain s
The choice of jquery consists of two kinds, one is selector, the other is filter. The filter is a further selection of the jquery object selected by the selector.
Children () is a filter, as the name implies is to screen children, screening those who meet the conditions of
Use the filter function to filter the qualified DOM elements from the wrapper set.such as HTML code, if we want to get the class name filter ahref="#"class= "Filter">Linka> ahref="#"class= "filter">Linka> ahref="#">Linka> ahref="#"class= "
This article introduces the usage of filter () and find () and the difference analysis between children () and find. If you need a friend, refer to jquery's find () method and filter () method, which are easy to confuse for beginners. Here we use a small example to compare and describe these two methods. It aims to understand the differences between the two methods.
Html code
The Code is as follows:
Te
This example describes the jquery filter selector usage. Share to everyone for your reference, specific as follows:
The effect is as shown in the following illustration:
More interested readers of jquery-related content can view the site topics: "jquery selector Usage Summary", "
The examples in this article describe the jquery visibility filter selector usage. Share to everyone for your reference, specific as follows:
Effect Chart:
More interested readers of jquery-related content can view the site topics: "jquery selector Usage Summary", "JQu
This example describes the jquery child element filter selector usage. Share to everyone for your reference, specific as follows:
The effect chart is as follows:
More interested readers of jquery-related content can view the site topics: "jquery selector Usage Summary", "
Filter (), not ():Program codeA new challenge is to select only one particular element from a set of similar or identical elements.jquery provides filter () and not () to do this.Filter () is able to refine the element to only those that satisfy the filter, not () on the contrary, he removes all the conditions that satisfy the condition. -Split ():Program code Ge
This example describes the jquery filter selector usage. Share to everyone for your reference. The specific analysis is as follows:
In practice, you can add a filter selector based on the basic selector to complete the query task, in the filter selector can use the element's index value, content, attributes, child ele
Select the sequential filter by order (Filter) has
: First
First element
: Last
Last element
: Even
An element with an even number
: Odd
An element with an odd number
: EQ (N)
element with ordinal equal to n
: LT (N)
element with ordinal less than n
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