JSFiddle - React, Tailwind, and code Playground
by taneleero
HTML
<input type="text" value="This is a test" style="width:50px">
<div></div>
CSS
div {
visibility:hidden;
position:absolute;
z-index:-10;
}
JavaScript
$('input').hover(function(){
var temp = $('div').html($(this).val()).width();
alert(temp);
if($(this).width() < temp){
$(this).animate({
}, 100);
}
});