JSFiddle - React, Tailwind, and code Playground

by jdanyow

HTML

<input type="number" />
<p></p>

JavaScript

$('p').html($('input').attr('type'));

$('input').on('focus', function(e) {
    $('p').html($('input').attr('type'));
    setTimeout(
        function() { 
            $(e.target).attr('type', 'text'); 
            $('p').html($(e.target).attr('type'));
        }, 
        1000);
});

$('input').on('focus', function(e) {
     $(e.target).attr('type', 'number');
     $('p').html($('input').attr('type'));
});