article

Tuesday, June 8, 2010

jQuery textbox set focus


jQuery textbox set focus



<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
$(function () {
$('input[type="text"]').focus(function() {
$(this).addClass("focus");
});

$('input[type="text"]').blur(function() {
$(this).removeClass("focus");
});
});
</script>
<style>
.focus {
border: 2px solid #AA88FF;
background-color: #FFEEAA;
}
</style>














Name
Address
Web Sites.




Demo

http://creativedesign-mind.com/r-ednalan/demo/jQuery_textbox_set_focus.html

Related Post