为了账号安全,请及时绑定邮箱和手机立即绑定

有个问题,如果你调用了onmouseover属性,当我确定要点击它之后,该怎么办。。

正在回答

2 回答

<!DOCTYPE HTML>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title> 鼠标经过事件 </title>
<script type="text/javascript">
    function message(){
		 var abc=document.getElementById("123").value;
		if(abc !=null){}
		else{alert("请输入密码后,再单击确定!");}
		}
  function write1(){       
        document.write("请问你能看到我么?")
    }
    
</script>
</head>
<body>
<form>
密码:<input id="123" name="password" type="password" >
<input name="确定" type="button" value="确定" onmouseover="message()" onclick="write1()"/>
</form>
</body>
</html>


0 回复 有任何疑惑可以回复我~

你可以在message()这个函数中加判断,判断不为空的时候再弹出alert()

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信