Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
/ seek Public

Seek is a pure-JavaScript CSS selector engine using browser native API.

Notifications You must be signed in to change notification settings

S-Core/seek

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SEEK

Seek is a pure-JavaScript CSS selector engine using browser native API. We used native API to make it lightweight. It provide a convenience to find elements for manipulation.

  • querySelectorAll
  • getElementById
  • getElementsByTagName
  • getElementsByClassName

Browser Supports

A browers must support the native function of 'querySelectorAll'.

As such, the following browsers are supported:

  • Chrome 16+
  • Edge 12+
  • Firefox 3.6+
  • Internet Explorer 9+

API

  seek( String selector [, DOMNode context [, Array result]] )

The main function for finding elements. use 'querySelectorAll'.

Parameters

  • selector: A CSS selector.

  • context: An element, document, or document fragment to use as the context for finding elements.

    ( Defaults : window.document )

  • result: An array.

Return

  • returns: All elements matching the selector.

Selector

seek supports CSS3 Selector and some functional selector. And results returned in document order.

As such, the following pseudo-selectors are not supported:

  • :hover
  • :active
  • :visit, :link

As such, the follwing functional selector:

  • :first/:last : the first/last matching element.
  • :even/:odd : Even/odd-numbered elements.
  • :eq(NUMBER)/:nth(NUMBER) : the nth element. ':eq(1)' finds the second element.
  • :lt(NUMBER)/:gt(NUMBER) : Elements at positions above/below the specified position.
  • :contains(TEXT) : Elements with textContent containing the word 'TEXT'.

Example

// Finds odd table rows.
var elems = seek(  "#content-table tr:odd"  )

Testing

Open the test/index.html on a web browser.

LICENSE

GNU Lesser General Public License version 2.1.

About

Seek is a pure-JavaScript CSS selector engine using browser native API.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 9

Morty Proxy This is a proxified and sanitized view of the page, visit original site.