JSFiddle - React, Tailwind, and code Playground

by LinkinTED

HTML

<span>Dynamicly add overflow auto to .box by clicking this text</span>

<div class="box">
    <div>text<br />text<br />text<br />text<br /></div>
</div>

CSS

.box {
    width: 500px;
    border: 1px solid red;
}
.box > div {
    width: 250px;
    background: lightgreen;
    float: right;
    min-height: 200px;
}

JavaScript

$("span").on("click", function() {
   $(".box").css('overflow', 'auto');   
});