慕粉4065414
2016-11-26 19:19
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>鼠标移开事件 </title>
<script type="text/javascript">
function message(){
alert("不要移开,点击后进行慕课网!"); }
</script>
</head>
<body>
<form>
<a href="http://www.imooc.com"onmouseout="message()">点击我</a>
</form>
</body>
</html>
可能是慕课网的问题,你自己新建一个HTML文件,然后用自己浏览器打开,应该是可以的。
可能是楼主浏览器设置成禁用脚本运行了
我把你的代码复制到webstorm中,是正常的
<a href="http://www.imooc.com" onmouseout="message()">点击我</a>
中间有个空格
JavaScript进阶篇
469067 学习 · 22582 问题
相似问题