html-attribute-parser

1.0.0 • Public • Published

html-attribute-parser

NPM version Build Status Dependency Status Coverage percentage

Installation

  npm install --save html-attribute-parser

Usage

var htmlAttributeParser = require('html-attribute-parser');
 
let text = '<button attr class="btn btn-primary" id="submit" on-click="callFunction()">Hello world</button>';
 
let tag = htmlAttributeParser(text)
console.log(tag);
 
/* return
{ tagName: 'button',
  attributes: 
   { attr: true,
     class: 'btn btn-primary',
     id: 'submit',
     'on-click': 'callFunction()' },
  value: 'Hello world' }
*/

Getting To Know Yeoman

Yeoman has a heart of gold. He's a person with feelings and opinions, but he's very easy to work with. If you think he's too opinionated, he can be easily convinced. Feel free to learn more about him.

Created with

Yeoman and Generator-simple-package

License

MIT © Nghia Tran

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    333
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    333
  • 0.0.0
    0

Package Sidebar

Install

npm i html-attribute-parser

Weekly Downloads

269

Version

1.0.0

License

MIT

Last publish

Collaborators

  • nghiattran