JQuery Focus Event

Focus, Focusin, Focusout Event
$(document).ready(function () {
$("#txtInput1").focus(function (event) {
    $("#txtInput1").css("background-color", "Green");
});
$("#txtInput2").focusin(function (event) {
   $("#txtInput2").css("background-color", "Yellow");
});
$("#txtInput3").focusout(function (event) {
   $("#txtInput3").css("background-color", "Red");
});
});
Focus     : <input id="txtInput1" type="text" /> 
Focus In  : <input id="txtInput2" type="text" /> 
Focus Out : <input id="txtInput3" type="text" /> 
Demo / Download
JQuery Focus Event JQuery Focus Event Reviewed by Bhaumik Patel on 8:45 PM Rating: 5