JSFiddle - React, Tailwind, and code Playground

by jitendravyas

HTML

<div style="width="500px">
<div id="name" style="float:left">

    Name:
    <input  type="textbox" />
        </div>
    <div id="email" style="right">      
Email:
            <input type="textbox" />
    </div>
</div>

JavaScript

$("input").focus(function()
                 {
                     var currentSelectedInput=this;

                     $("input").each(function()
                                     {
                                     if(this!=currentSelectedInput)
                                         $(this).parent().hide();
                                     });
                     $(this).css("width","100%");
                 });

$("input").blur(function(){
    $("input").each(function()
                                     {
                                         if($(this).parent().is(":visible")){
                                             $(this).css("width","auto");
                                         }
                                         else{
                                         $(this).parent().show();
                                         }
                                     });
                 });