JSFiddle - React, Tailwind, and code Playground

by Manuel Gertrudix

HTML

<body>

<p>Este ejemplo usa el HTML DOM para asignar un evento "onkeyup" a un elememento HTML "input"</p>

<p id="pulsa">Escribe tu nombre en minúscula en el campo de texto y observa cómo se convierte automáticamente en mayúscula.</p>

Introduce tu nombre: <input type="text" id="fname">

<script>
document.getElementById("fname").onkeyup = function() {myFunction()};

function myFunction() {
    var x = document.getElementById("fname");
    x.value = x.value.toUpperCase();
}
</script>

</body>

CSS

p {color: #00008B;
   font-family: "Book Antiqua", Palatino, "Palatino Linotype", "Palatino LT STD", Georgia, serif;
    font-weight: bold;}

p#pulsa {color: #FF0000;}