Jquery按钮换色
看代码
<!DOCTYPE html>
<html>
<head>
<style>
div { position: absolute; width: 60px; height: 60px; float: left; }
.first { background-color: #3f3; left: 0;}
.second { background-color: #33f; left: 80px;}
</style>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
<p><button>Run</button></p>
<input id="Button2" type="button" value="button" />
<div class="first"></div>
<div class="second"></div>
<script>
$("button").click(function() {
$("#Button2").css("background","#00a0e9");
setTimeout(function(){ $("#Button2").css("background","#7ecef4");}, 500);
});
</script>
</body>
</html>