<!DOCTYPE html>
<html>
<head>
<title>jQuery mousedown() and mouseup() method</title>
<script src="jquery-latest.min.js"></script>
<script>
$(document).ready(function(){
$("input").mousedown(function(){
$("input").css("background-color", "yellow");
});
$("input").mouseup(function(){
$("input").css("background-color", "pink");
});
});
</script>
</head>
<body>
Name: <input type="text" name="name" />
</body>
</html>