0.3.1 • Published 10 years ago

annex v0.3.1

Weekly downloads
3
License
MIT
Repository
github
Last release
10 years ago

annex

DOM insertion module

npm install annex --save

API

annex() instance

annex(markup|node|stack)

annex('<a href="/">home</a>').appendTo(document.body) // annex(markup) example
annex(document.body).append('<a href="/">home</a>') // annex(node) example
annex(document.querySelectorAll('.example')).remove() // annex(stack) example

Chain

jQuery-compatible syntax

  • .html(string?) Get or set.
  • .text(string?) Get or set.
  • .tag() Get markup string.
  • .tags() Get markup array.
  • .after(content...) Insert content.
  • .before(content...) Insert content.
  • .append(content...) Insert content.
  • .prepend(content...) Insert content.
  • .appendTo(target) Insert into target.
  • .prependTo(target) Insert into target.
  • .detach() Detach nodes from DOM for later use.
  • .remove() Detach nodes from DOM and purge.
  • .empty() Empty nodes.
  • .clone() Clone nodes.

Static

Fast simple static methods

  • annex.text(node) Get.
  • annex.html(node) Get.
  • annex.contents(node) Get nodes.
  • annex.tag(node) Get markup string.
  • annex.tags(nodes) Get markup array.
  • annex.detach(node) Detach from DOM.
  • annex.empty(node) Empty node.
  • annex.owner(node) Get owner document.

Fund

Fund opensource dev =)

License

MIT

0.3.1

10 years ago

0.3.0

10 years ago

0.2.0

10 years ago

0.1.6

12 years ago

0.1.5

12 years ago

0.1.4

12 years ago

0.1.3

12 years ago

0.1.2

12 years ago

0.1.1

12 years ago

0.1.0

12 years ago