JSFiddle - React, Tailwind, and code Playground

by blue1086

HTML

<div id="SearchDiv">Hello there...</div>

<button type="button" onClick="changeHeight();">Click Me!</button>

CSS

#SearchDiv {
    background-color:red;
    width:1000px;
    height:20px;
    -webkit-transition: 2s height ease;
    transition: 2s height ease;/*change 2s to whatever time you want*/
}

JavaScript

function changeHeight() {
    document.getElementById('SearchDiv').style.height = "200px";
}