create-element-from-selector
document.createElement from a selector.
Last updated 4 years ago by kchan .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install create-element-from-selector 
SYNC missed versions from official npm registry.

create-element-from-selector

NPM version NPM downloads Build Status

Install

$ npm install --save create-element-from-selector

Usage

const createElement = require('create-element-from-selector')

const element = createElement('div#foo.bar')
//=> <div id="foo" class="bar"></div>

const elementObj = createElement.parse('div#foo.bar')
//=>
//  {
//    tagName: 'div',
//    classList: ['bar'],
//    id: 'foo'
//  }

API

createElement(selector)

selector

A valid dom selector.

createElement.parse(selector)

License

MIT © EGOIST

Current Tags

  • 0.1.0                                ...           latest (4 years ago)

1 Versions

  • 0.1.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (3)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |