JSFiddle - React, Tailwind, and code Playground

HTML

<p class="foo">
    <canvas class="wee" />
</p>

JavaScript

// grab the object, with HTML 5 element(s).
var p = $('p');

// clone it
var c = p.clone();
alert(c);
// grab the inner html (wrap it so we can get the HTML)
var html = $('<div>').append(c).html();

// alert of of the contents
alert(html);