2.2.1 • Published 11 years ago

unpack-element v2.2.1

Weekly downloads
11
License
-
Repository
github
Last release
11 years ago

unpack-element

unpack an element's children based on their id

Example

Take a dom element and unpack it into it's children based on their ids

<div>
    <ul id="list">
    </ul>
    <span id="foo"></span>
</div>
var unpack = require("unpack-element")

var elements = unpack(thatDiv)
elements.root // that div
elements.list // that ul
elements.foo // that span

unpack removes the id attributes from the child nodes. This is useful if your template generates a dom element with common ids in it and you want to have access to those "named" children inside your template without having global id's in your DOM

Installation

npm install unpack-element

Contributors

  • Raynos

MIT Licenced

2.2.1

11 years ago

2.1.1

11 years ago

2.0.1

11 years ago

1.1.3

11 years ago

1.1.2

11 years ago

1.1.1

11 years ago

1.0.3

11 years ago

1.0.2

11 years ago

1.0.1

11 years ago

1.0.0

11 years ago

0.2.1

12 years ago

0.2.0

12 years ago

0.1.0

12 years ago

0.0.1

12 years ago