JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" id="testid" class="testclass" name="testname" placeholder="Event call using id on textbox click" >
<input type="text" id="testid2" class="testclass2" name="testname2" placeholder="Event call using class on textbox leave" >
JavaScript
$(document).ready(function(){ // jquery start
$("#testid").click(function(){ // text box click event
alert("You have clicked"); // message to be displayed
})
});
$(document).ready(function(){ // jquery start
$(".testclass2").blur(function(){ // text box blur event
alert("This is use of class selector"); // message to be displayed
})
});
$(document).ready(function(){ // jquery start
$("input").blur(function(){
$(this).css("border", "1px solid red");
});
});