求指教,请问我该如何添加2个javascript函数,来响应mouseover事件?

1>响应mouseover事件, 弹出对话框“mouse over!”2>响应mouseout事件, 弹出对话框”mouse out!”<html><head><script type="text/javascript">::</script></head> <body><a href="./test1.html" target="_blank"><img border="0" alt="Cannot show this pic." src=./a.jpg" name="pic1"onmouseOver="mouseOver()"onmouseOut="mouseOut()" /></a></body></html>

慕尼黑的夜晚无繁华
浏览 312回答 1
1回答

牛魔王的故事

你的写法基本都是对的,现在只需有用javascript定义两个事件处理函数,并且加上弹出对话框代码就可以了。<html><head><scripttype="text/javascript">functionmouseOver(){alert("mouseover");}functionmouseOut(){alert("mouseout");}</script></head><body><ahref="./test1.html"target="_blank"><imgborder="0"alt="Cannotshowthispic."src=./a.jpg"name="pic1"onmouseOver="mouseOver()"onmouseOut="mouseOut()"/></a></body></html>
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Vue.js
JQuery