国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > JS > 正文

cssQuery()的下載與使用方法

2024-09-06 12:43:49
字體:
來源:轉載
供稿:網友
Introduction
cssQuery() is a powerful cross-browser JavaScript function that enables querying of a DOM document using CSS selectors. All CSS1 and CSS2 selectors are allowed plus quite a few CSS3 selectors.

Usage
Syntax
elements = cssQuery(selector [, from]);where selector (required) is a valid CSS selector and from (optional) is a document, element or array of elements which is filtered by selector.

The function returns a JavaScript array of elements. If there is no match, an empty array is returned.

Some examples:

// find all paragraphs that are direct descendants// of the document bodyvar tags = cssQuery("body > p");// find all elements with the "href" attributevar tags = cssQuery("[href]");// find all anchor elements with "href" equal to "#"var tags = cssQuery("a[href='#']");// find all images contained by the above anchorsvar images = cssQuery("img", tags);// find all listsvar tags = cssQuery("dl,ol,ul");// query an external xml documentvar tags = cssQuery("my|:root>my|link", myXMLDoc);// just plain complicatedvar complex = "p>a:first-child+input[type=text]~span";var tags = cssQuery(complex);Allowed Selectors


E F 
E > F 
E + F 
E ~ F 
E.warning 
E#myid 
E:link 
E:first-child 
E:last-child 
E:nth-child(n) 
E:nth-last-child(n) 
E:only-child 
E:root 
E:lang(fr) 
E:target 
E:enabled 
E:disabled 
E:checked 
E:contains("foo") 
E:not(s) 
E[foo] 
E[foo="bar"] 
E[foo~="bar"] 
E[foo^="bar"] 
E[foo$="bar"] 
E[foo*="bar"] 
E[foo|="bar"] 
Compatibility
Known to work on the following platforms:

Microsoft Internet Explorer 5+ (Windows) 
Microsoft Internet Explorer 5.2 (Mac) 
Firefox/Mozilla 1.6+ 
Opera 7+ 
Netscape 6+ 
Safari 1.2 

Source Code

cssQuery.js cssQuery-level2.js cssQuery-level3.js cssQuery-standard.js
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 尉氏县| 丰城市| 长海县| 获嘉县| 武定县| 彭山县| 镇坪县| 松江区| 鄄城县| 剑川县| 安岳县| 杂多县| 南靖县| 南京市| 克什克腾旗| 贡嘎县| 呼图壁县| 武强县| 定西市| 南涧| 达孜县| 平泉县| 竹溪县| 集贤县| 中牟县| 渝北区| 通州区| 柘荣县| 嘉峪关市| 北流市| 陇川县| 博白县| 颍上县| 英山县| 方山县| 姚安县| 夏河县| 花莲县| 鲁山县| 鲁山县| 武宁县|