Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
html -> elements
JavaScript Makefile
Branch: master
Failed to load latest commit information.
test add support for <g> svg elements
.gitignore ignore the build files
.gitmodules Initial commit
History.md Release 1.4.0
Makefile Makefile: .PHONY: build
Readme.md Update usage example
component.json Release 1.4.0
index.js Fix typo
package.json Release 1.4.0

Readme.md

domify

Turn HTML into DOM elements x-browser.

Usage

Works out of the box in the browser:

var domify = require('domify');

document.addEventListener('DOMContentLoaded', function() {
  var el = domify('<p>Hello <em>there</em></p>');
  document.body.appendChild(el);
});

You can also run it in node and iojs. Just pass a custom implementation of document:

var jsdom = require('jsdom').jsdom();

domify('<p>Hello <em>there</em></p>', jsdom.defaultView.document);

Running tests

$ npm i -g component-test
$ make
$ component-test browser

License

MIT

Something went wrong with that request. Please try again.