JSFiddle - React, Tailwind, and code Playground

by gromer

HTML

<div id="a">This will hide</div>
<button id="b">Hide!</button>
<button id="add">Add</button>

<div id="content">Dynamic content will go here...</div>

CSS

.initial-hide {
    display: none;
}

JavaScript

$(document).on('hide', '#b', function() {
    $('#a').hide();
});

$('#add').click(function() {
    $('#content').html('<div>You can see me!</div>');
    $('#content').append('<div class="initial-hide">You can\'t see me!</div>');
});