用dw写代码,在浏览器中点击按钮没反应

来源:2-7 编程练习

Carsoner

2016-03-14 16:29


<!DOCTYPE HTML>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; 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>


写回答 关注

2回答

  • 芳的独家记忆
    2016-03-14 16:53:36

    你的浏览器是不是设置了禁止窗口弹窗?

  • 山南水北_shen
    2016-03-14 16:43:25

    是不是没有保存,这段代码我copy了下,可以用,有反应

    Carson...

    。。。不知道怎么回事,现在又行了

    2016-03-15 10:34:41

    共 1 条回复 >

JavaScript入门篇

JavaScript做为一名Web工程师的必备技术,本教程让您快速入门

738244 学习 · 9560 问题

查看课程

相似问题