Query Javascript CSS Selector engine

Source: Internet
Author: User

Query is a javascript css selector engine that is compact and powerful. It is compressed for about 2 K and can be easily integrated into the code.
Support for browsers

IE6 +, Firefox, Chrome, Safari, and Opera

Selector
Query (selector [, context])
Div
# Intro
Div # intro
. Red
Span. red
[Name]
[Name = keywords]
Input [name]
Input [name = keywords]
Input [name = 'keyword']
Input [name = "keywords"]
Input [name * = key]
Label [class ~ = Red]
# Nav> li
# Nav> li
# Nav> li
# Nav> li
# Nav li
# Intro,. red, div
Input [name], # nav> li

NATIVE METHOD

Query. getById (id)
Query. getByName (name)
Query. getByTagName (tagName [, parent])
Query. getByClass (className [, parent] [, tagName])
Example:
Query. getByClass ("red ");
Query. getByAttr (name, val [, parent] [, tagName])
Example:
Query. getByAttr ("name", "keywords", parent, "input ");
Query. extend
Example:
Query. extend ({
GetByCity: function (){...}
});
Var city = query. getByCity ();

Download: http://tanwei-cc.github.com/query/
Https://github.com/tanwei-cc/query

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.