JSFiddle - React, Tailwind, and code Playground
by lalatino
HTML
<div class = "auto">
<div id="div1">
C:/DOS<br />
C:/DOS/RUN<br />
RUN/DOS/RUN<br />
</div>
</div>
<button onclick="add()">add</button>
CSS
.auto {
width:100px;
height:100px;
border:1px solid green;
overflow-x:visible;
overflow-y:auto;
}
JavaScript
function add(){
var newline = document.createTextNode('abcdefghijkl');
document.getElementById('div1').appendChild(document.createElement('br'));
}