<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>切换图片</title>
<script src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
<script>
$(function() {
$("img").toggle(function() {
$(this).attr("src", "http://www.google.co.jp/images/logos/ps_logo2.png");
}, function() {
$(this).attr("src", "http://www.baidu.com/img/baidu_sylogo1.gif");
});
});
</script>
</head>
<body>
<img src="http://www.baidu.com/img/baidu_sylogo1.gif" />
</body>
</html>