userName = window.prompt("请输入你的名字","张三");

解决方案 »

  1.   

    var userinput=prompt("请输入你的年龄:","100");
    则变量userinput为用户输入的数据(字符型,不是数值型)。第一个参数是输入框上的提示信息,第二个参数是默认的输入值,可以为空。
      

  2.   

    <script language=javascript>
    prompt("Please enter your msg!","default");
    </script>
      

  3.   

    那上面的"javascript对象提示"几个字可不可去掉?
      

  4.   

    去不掉
    要想去掉“javascript对象提示”,只有用 showModalDialog 了,更麻烦,而且还会有别的提示
      

  5.   

    <script language=javascript>
    confirm("这是一个含有'确定'和'取消'的提示框,不知是不是你要的。");
    </script>
      

  6.   

    <script language=javascript>
    promtp("你要输入的内容")
    </script>
      

  7.   

    prompt--------------------------------------------------------------------------------DescriptionDisplays a Prompt dialog box with a message and an input field. Syntax
    object.prompt([message [, inputDefault]])Parameter Description 
    message  Optional. (String) String to display. 
    inputDefault  Optional. (String) String or integer that represents the default value of the input field. Return ValueReturns the value that the user types in. ResIf the inputDefault parameter is not supplied, the dialog box displays the value <undefined>. You have no control over the title of the prompt box. Applies Towindow