JSFiddle - React, Tailwind, and code Playground

by vincentpace

HTML

<input type="text">
<input type="number">
<br>
<input type="text">
<input type="number">

CSS

[type="text"] {background-color:yellow;}
[type="number"] {background-color:orange;}

JavaScript

$(document).ready(function(){
    $("[type='number']").hide();
    $("[type='text']").on("focus",function(){
        $(this).next().show().focus();
        $(this).hide();
    });
    $("[type='number']").on('blur',function(){
        /* $(this).prev().show(); */
        $(this).hide();
    });
});