JSFiddle - React, Tailwind, and code Playground

by Muhammad Habib

HTML

<div contenteditable='true' id='a' onkeyup='checkHeight()'>Edit Me</div>
<div contenteditable='true' id='b'>Edit Me 2</div>

<div>Current Height :  <span id='status'></span></div>

JavaScript

function checkHeight(){
    var divA = document.getElementById('a');
    var divB = document.getElementById('b');
    var status = document.getElementById('status');
    status.innerHTML = divA.clientHeight;

    if(divA.clientHeight>100) {
         //move the exceeded text to div B
    }
}