queryselectorall

A simple wrapper for querySelectorAll. Takes query string or dom node and returns an array of elements or element respectively.


Keywords
querySelectorAll, Array
License
ISC
Install
npm install queryselectorall@0.1.0

Documentation

#querySelectorAll

Takes query string or dom node and returns an array of elements or element respectively. Beats having to deal with testing whether the passed value is a string or a dom node.

##Example

  var $ = require('querySelectorAll');

  $(document.body).forEach(function(el){
      console.log(el);
  });

  $('body').forEach(function(el){
      console.log(el);
  });

##API

$(:domQueryString) <- [:NodeList]

Takes a DOM query string and return a native array type made up of HTMLElements

$(:domNode) <- [:Node]

Takes a DOM and returns the dom node in an array

##License Copyright (c) 2015, Vignesh Anand Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.