<!DOCTYPE html>
<html>
<head>
<title>jQuery mouseenter() and mouseleave() method</title>
<script src="jquery-latest.min.js"></script>
<script>
$(document).ready(function(){
$("input").mouseenter(function(){
$("input").css("background-color", "yellow");
});
$("input").mouseleave(function(){
$("input").css("background-color", "pink");
});
$("#btn1").click(function(){
$("input").mouseenter();
});
$("#btn2").click(function(){
$("input").mouseleave();
});
});
</script>
</head>
<body>
<button id="btn1">Trigger MouseEnter</button>
<button id="btn2">Trigger MouseLeave</button>
<br /><br />
Name: <input type="text" name="name" />
</body>
</html>