How to make a div into a string? Here's the example of how I want it to be:
<div class="teste">oi</div>
on:
"<div class="teste">oi</div>"
How to make a div into a string? Here's the example of how I want it to be:
<div class="teste">oi</div>
on:
"<div class="teste">oi</div>"
Just use Element.outerHTML
. Example:
var toString = document.getElementById('foo').outerHTML;
alert(toString);
<div id='foo' class='bar' data-baz='2015'>StackOverflow</div>