<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
src='http://code.jquery.com/jquery-1.9.1.js'></script>
<style type='text/css'>
.button {
width: 200px;
height: 100px;
background-color: #000;
opacity: 1.0;
transition: opacity 2s linear;
-webkit-transition: opacity 0.5s linear;
-o-transition: opacity 0.5s linear;
-moz-transition: opacity 0.5s linear;
-ms-transition: opacity 0.5s linear;
}
.button:hover {
opacity: 0.7;
}
</style>
<script type='text/javascript'>//<![CDATA[
$(window).load(function(){
$(function() {
$(".button").click(function(){
$(this).css("opacity", "0.2");
});
});
});//]]>
</script>
</head>
<body>
<div class="button"></div>
</body>
</html>