JSFiddle - React, Tailwind, and code Playground

by galvakojis

HTML

<form name="FormName">

    Number of text rows to display: 
    <input type="text" name="RowsInputName" size="6" onkeyup="changeHeight()" /><br />
    
    Number of characters to display per row: 
    <input type="text" name="ColsInputName" size="6" onkeyup="changeWidth()" /><br />    

    <textarea name="TextareaName" cols="40" rows="5"></textarea>

</form>

JavaScript

function changeHeight() {
    alert('a');
document.FormName.TextareaName.rows = document.FormName.RowsInputName.value;
}

function changeWidth() {
document.FormName.TextareaName.cols = document.FormName.ColsInputName.value;
}

$(document).ready(function(){
    changeWidth();
    changeHeight();
}