htmltostring
v1.0.6
Published
convert html DOM element to string
Downloads
2
Maintainers
Readme
htmlToString
Convert html/DOM element to string
Works with rendered and virtual DOM
Installation
npm install htmltostring
Or using CDN
<script src="https://cdn.jsdelivr.net/npm/[email protected]/htmlToString.min.js"></script>
Usage
import htmlToString from 'htmltostring'
console.log(htmlToString('.container'))
// or
// const container = document.querySelector('.container')
// console.log(htmlToString(container))
Example Output
<div class="container">
<h1>Hello World</h1>
</div>