JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 24
  • Score
    100M100P100Q47690F
  • License MIT

A tiny DOM element selector

Package Exports

  • tiny-element

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (tiny-element) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

tiny-element

A tiny DOM element selector

browser support

Install

npm install tiny-element --save

Usage

var element = require('tiny-element');

var el = element('.parent .some-selector');
var els = element('.some-elements', true); // This returns an ACTUAL array of DOM elements

element(selector[, multiple])

  • selector - a css selector OR DOM element. If a DOM element is passed in, it just returns that DOM element. It's a nice abstraction to avoid always testing for a selector or DOM element.
  • multiple - should the query return multiple DOM elements. This is useful because it returns an actual array or DOM elements instead of a pseudo-array.

Run Tests

Requires Phantomjs is installed

npm install
npm test