jquery Class Nine Selector

Source: Internet
Author: User

jquery Selector Basic Selector
#id/标签名/样式名/选择器A,选择器B           
jquery Hierarchy Selector
*form input:查询form下所有input元素,含有后代关系form>input:查询form下所有input元素,有有父子关系,没有后代关系form+input:查询与form同级的第一个input元素,是兄弟关系form~input:查询与form同级的所有input元素,是兄弟关系
jquery-Enhanced Basic Selector
:first:查询第一个元素:last:查询最后个元素:checked:查询选中的复选框:not(:checked):查询未选中的复选框:even:偶数:odd:奇数:eq():索引从0开始:gt():大于索引号:lt():小于索引号:header:查询所有

jquery Content Selector
:contains(‘john‘):表示包含指定字符串的标签,字符串大小写敏感:empty:表示查询空标签的元素:has(‘p‘):表示查询有子元素的元素 .addClass("样式名"):为查询到的所有标签添加样式:parent:表示查询非空标签

jquery Visibility Selector
: Hidden: means querying all hidden tags
: visible: Indicates that all displayed labels are queried
Or: Not (: Hidden)

jquery Property Selector
div[id]:表示查询含有id属性的div元素input[name=‘newsletter‘]:表示查询含有name属性,且其值是"newsletter"的input元素input[name!=‘newsletter:表示查询含有name属性,且其值不是"newsletter"的input元素input[name^=‘newsletter:表示查询含有name属性,且其值以"news"开头的input元素"input[name$=‘letter‘:表示查询含有name属性,且其值以"letter"结尾的input元素input[name*=‘news‘]::表示查询含有name属性,且其包含"news"的input元素input[id][name$=‘letter‘]:表示查询含有id属性,且含有name属性,其值以"letter"字符串结束的input元素  
jquery child element Selector
:first-child:表示查询第一个子元素:last-child:表示查询最后一个子元素:only-child:表示查询只有一个子元素的元素:nth-child(编号从1开始),表示查询指定编号的元素  
jquery form Selector
:input:查找所有input元素的个数,注:包含所有input,textarea,select和button元素:text:password:radio:checkbox:file:submit:reset:image:file
Form Object Properties
:enabled:表示查询可用的元素:disabled:表示查询不可用的元素:checked:表示查询选中的复选/单选框的元素:selected:表示查询选中的下拉框元素

jquery Class Nine Selector

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.