dom-to-string

Cross browser DOM to string converter.

Usage no npm install needed!

<script type="module">
  import domToString from 'https://cdn.skypack.dev/dom-to-string';
</script>

README

dom-to-string

Build Status npm version

Cross browser DOM to String converter.

Installation

npm install dom-to-string --save

Usage

const dom2str = require('dom-to-string');

var p = document.createElement('p');
p.innerHTML = "hello";

dom2str(p); // '<p>hello</p>'