Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including es6-query with all npm packages installed. Try it out:

var es6Query = require("es6-query")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

es6-query v1.0.0

Simple, lightweight, DOM manipulation object using plain ES6 syntax

es6-query

Build Status devDependency Status

Simple, lightweight, DOM manipulation object using plain ES6 syntax.

Getting Started

Install

npm install es6-query --save-dev

Usage

import query from 'es6-query';

//-- Simple example
const dom = query('#some-id');

if(dom.hasClass('some-class')){
    dom.removeClass('some-class');
}

//-- It's chainable!
dom.addClass('chain').removeClass('some-class');

API

  • addClass(name:String)
  • removeClass(name:String)
  • hasClass(name:String)
  • toggleClass(name:String)
  • remove()
  • get(index:int)
  • data(name:int)

Tests

npm test

License

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free