JSFiddle - React, Tailwind, and code Playground

HTML

<div id="page" class="someclass"> more divs </div>

JavaScript

$.fn.tag = function() {
   return this.first().clone().empty().prop('outerHTML');
}

console.log($('#page').tag());