JSFiddle - React, Tailwind, and code Playground

by Alexis LĂłpez Espinoza

HTML

Escribe algo: <input type = "text" id = "algo" />

CSS

#algo{
    background: red;
}

JavaScript

document.getElementById("algo").addEventListener("keyup", function(){
    this.style.background = this.value.length < 5 ? "red" : "white";
}, false);