<!DOCTYPE html>
<html>
<head>
<title>jQuery blur() method</title>
<script src="jquery-latest.min.js"></script>
<script>
$(document).ready(function(){
$(".btn1").click(function(){
$("input").focus();
$("input").css("background-color","yellow");
});
$(".btn2").click(function(){
$("input").blur();
$("input").css("background-color","white");
});
});
</script>
</head>
<body>
<button class="btn1">Trigger focus</button>
<button class="btn2">Trigger blur</button>
<br /><br />
<div>
Name: <input type="text" name="name" />
</div>
</body>
</html>