JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" />
<div></div>

CSS

div {background:#c00; width:300px; margin-top:50px}

JavaScript

$('input').keydown(function(e){
   if(!(e.which >= 48 && e.which <=58) && e.which !== 8 && e.which !== 46 && e.which !== 37 && e.which !== 39){ //prevent anything other than numeric characters, backspace, delete, and left & right arrows
       return false;
   }
})
.keyup(function(){
   val = $(this).val();
   
   $('div').height(val * 10);
});