JSFiddle - React, Tailwind, and code Playground

HTML

<textarea id="box" style="width:50;"></textarea>

JavaScript

$("#box").focus(function () {
            /*to make this flexible, I'm storing the current width & height in an attribute*/
            $(this).attr('data-defaultwidth', $(this).width());
            $(this).attr('data-defaultheight', $(this).height());
            $(this).animate({
                width: 400
            }, 'slow');
            $(this).animate({
                height: 300
            }, 'slow');
        }).blur(function () {
            /* lookup the original width */
            var w = $(this).attr('data-defaultwidth');
            var h = $(this).attr('data-defaultheight');
            $(this).animate({
                width: w
            }, 'slow');
            $(this).animate({
                height: h
            }, 'slow');
});