JSFiddle - React, Tailwind, and code Playground

HTML

<div id="output"></div>

JavaScript

var $content = $('<h1>title</h1><h2 id="xx">remove me</h2><p>some content or other</p>');

$content.remove('#xx');

$('#output').append($content);