confirm 不弹出消息对话框,是怎么回事?谢谢!
<!DOCTYPEhtml><htmllang="en"><head><metacharset="UTF-8"><title>实验confirm</title><scri...
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>实验confirm</title>
<script type="text/javascript">
function rec() {
var mymessage=confirm("你是男士还是女士")
if (mymessage==true)
{
document.write("你是女士")
};
else
{
document.write("你是男士")
}
}
</script>
</head>
<body>
<input name="button" type="button" onClick="rec()" value="点击我,弹出确认对话框" />
</body>
</html> 展开
<html lang="en">
<head>
<meta charset="UTF-8">
<title>实验confirm</title>
<script type="text/javascript">
function rec() {
var mymessage=confirm("你是男士还是女士")
if (mymessage==true)
{
document.write("你是女士")
};
else
{
document.write("你是男士")
}
}
</script>
</head>
<body>
<input name="button" type="button" onClick="rec()" value="点击我,弹出确认对话框" />
</body>
</html> 展开
4个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询