JSFiddle - React, Tailwind, and code Playground

by Torwan

HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
Please enter your name: <input type="text">   
<p> Please enter your name in the above input field.   
It will change the background color on keyup and keydown.</p>

JavaScript

$(document).ready(function(){  
    $("input").keydown(function(){  
        $("input").css("background-color", "red");  
    });  
    $("input").keyup(function(){  
        $("input").css("background-color", "blue");  
    });  
});