unpack-html

Unpack html source into elements

unpack-html

Unpack html source into elements

Uses unpack-element and fragment.Element to construct a DOM element from the source string and then unpack that DOM element into an object containing elements

var html = require("unpack-html")
    , source = "<div>hello <span id='thing'>world</span></div>"
 
var elements = html(source)
 
elements.root; // that div 
elements.thing; // that span 

npm install unpack-html

  • Raynos