<!DOCTYPE html>
<html>
<head>
<title>jQuery focusin() and focusout() method</title>
<script src="jquery-latest.min.js"></script>
<script>
$(document).ready(function(){
$("div").focusin(function(){
$(this).css("background-color", "yellow");
});
$("div").focusout(function(){
$(this).css("background-color", "white");
});
});
</script>
</head>
<body>
<p>Click on following text field to occur focusin or focusout events.</p>
<div style="padding:15px 10px;">
Name: <input type="text" name="name" />
</div>
<div style="padding:15px 10px;">
E-mail: <input type="text" name="email" />
</div>
<div style="padding:15px 10px;">
Phone: <input type="text" name="phone" />
</div>
</body>
</html>