(1)点击图片换图片
<script>
function yyy()
{
x=document.getElementById("hu");
if(x.src.match("baidu"))
{
x.src="../images/baidu.jpg";
}
else
{
x.src="../images/head.jpg";
}
}
</script>
<img id="hu" onclick="yyy()" src="images/baidu.jpg" >
</body>
</html>
(2)点击按钮出现对话框
<input type="button" onclick="alert('欢迎')" value="点击这
(3)鼠标悬浮动画
<img src="images/20080108104200265.png" name="mm" onmouseout="mouseover()" onmouseout="mouseout()" alt="鼠标" />
<script>
function hhh()
{
document.mm.sre="../images/baidu.jpg"}
}
function nnn()
{
document.mm.sre="../images/head.jpg"
}
</script>