鼠标经过事件(onmouseover)
任务
补充右边编辑器第13行,当鼠标经过"确定"按钮后,调用message()函数,弹出消息对话框。
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title> 鼠标经过事件 </title>
<script type="text/javascript">
function message(){
confirm("请输入密码后,再单击确定!"); }
</script>
</head>
<body>
<form>
密码:<input name="password" type="password" >
<input name="确定" type="button" value="确定" onmouseover="message()"/>
</form>
</body>
</html>
本文介绍了一个简单的HTML示例,展示了如何使用onmouseover事件触发JavaScript函数,实现鼠标悬停在按钮上时显示确认对话框的功能。


2257

被折叠的 条评论
为什么被折叠?



