How to use Focus() and Blure() Event on textbox control using JQuery in ASP.Net.
First, Download JQuery library from http://jquery.com. and include in web page at head section.
Design the ASP.Net web form with Three TextBox Control.
The ASP.Net web page design is :
Write below JQuery code at head section in aspx page.
<head>
<title>JQuery in ASP.Net</title>
<script src=”jquery-1.4.3.min.js” type=”text/javascript”></script>
<script>
$(document).ready(function() {
$(“input”).focus(function() {
$(this).css(“background-color”, “#00D96C”);
});
$(“input”).blur(function() {
$(this).css(“background-color”, “#ffffff”);
});
});
</script>
</head>
The JQuery Exmaple out put is :