JSFiddle - React, Tailwind, and code Playground

by apaul34208

HTML

<div class="class1">hello World</div>
<div class="class2">Goodbye world</div>

CSS

.class1, .class2 {
    border:1px solid red;
    position:absolute;
}
.class2 {
    top:30px;
}
.newClass {
    height:200px;
    width:100%;
    background:green;
}

JavaScript

$('.class1').click(function () {
    $('.class1').append("<div class='newClass'><h1>This is some content</h1></div>");
    $('.class2').css('top', $('.class1').offset().top + $('.class1').outerHeight());
});