JSFiddle - React, Tailwind, and code Playground

by Joe

HTML

<input type="text" id="box" style="width: 100px;" />

JavaScript

$('#box').focus(function()
{
    /*to make this flexible, I'm storing the current width in an attribute*/
    $(this).attr('data-default', $(this).width());
    $(this).animate({ width: 150 }, 'slow');
})