JSFiddle - React, Tailwind, and code Playground

HTML

<div id="resultado"></div>
<input id="input" type="text" />
<div id="inputLive"></div>

JavaScript

var testes = ['', '  ', '        ', 'a ', 0, '0', ' 0'];
testes.each(function (cobaia) {
    $('resultado').appendHTML(/^\s*$/.test(cobaia) + '<br />');
})
$('input').addEvent('keyup', function () {
    var input = this.value;
    $('inputLive').innerHTML = /^\s*$/.test(input);
});