1 / 19
文档名称:

js基础选择器(JS base selector).doc

格式:doc   大小:26KB   页数:19页
下载后只包含 1 个 DOC 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

js基础选择器(JS base selector).doc

上传人:rjmy2261 2017/11/18 文件大小:26 KB

下载得到文件列表

js基础选择器(JS base selector).doc

相关文档

文档介绍

文档介绍:js基础选择器(JS base selector)
Three, JQuery selector
Selectors are the foundation of JQuery. In JQuery, event handling, traversal of DOM and Ajax operations are dependent on selectors. This is also the focus of our study today.
1. basic selector
The basic selector is the mon selector in JQuery and the simplest selector. It searches for DOM elements through the elements ID, class, and tag names. This is very important, the following content is based on this, step by step improvement.
1). "$" ("#id") gets the element specified by ID, and ID is globally unique, so it has only one member.
2). "$" (".Class") gets the element specified by class, and different elements can have the same class attribute, so it may have multiple members.
3). "$" ("element") gets the element specified by element (element names, such as div, table, etc.), which may have multiple members.
4). "$(*)", getting all the elements, equivalent to document.
5). "$" (selector1, selector2),... "SelectorN"). The elements that match each selector are merged and returned together. Returns the set of selector1 matches, the set of +selector2 matches +... A set of +selectorN matches.
2. level selector
What is hierarchy? Hierarchy is the node of father son relationship and brotherhood. So, the hierarchical selector is used to obtain the father and son nodes and sibling nodes of the specified element.
1). "$" ("ancestor descendant") gets all the elements below the ancestor element.
2). "$(" parent > child ")", all the sub elements to obtain parent elements below (containing only the first level element).
3). "$" ("pre + next") gets the next sibling element that follows the pre element.
4). "$(" pre ~ siblings ") gets all the sibling elements behind the pre element.
3. filter selector
Filtration? The filter condition must be added. Add filter conditions, such as "$(" div:first "), to the first div element of the set of div elements, and first is the filter condition.
According to different filtering