Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    tiny-elementpublic

    tiny-element

    A tiny DOM element selector

    browser support

    Install

    NPM

    npm install tiny-element --save

    Bower

    bower install tiny-element --save
    <script src="bower_components/tiny-element/dist/tinyelement.js"></script>

    Usage

    Browser

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

    Browserify

    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

    install

    npm i tiny-element

    Downloadsweekly downloads

    3

    version

    1.1.0

    license

    MIT

    repository

    github.com

    last publish

    collaborators

    • avatar