问答详情
源自:2-7 编程练习

我们所用的函数prompt,是不是这样写的呢?


function prompt(str1,str2){
    window.open(,'_top','width=50,height=50....');
    document.write("<style type="text/css">"+
                "p,#pra{left:1px;}"+
                "#submit{left:200px;}"+
                "#cancel{left:250px;}"+
                "</style>"
        "<title>"+//获取标题+"</title>"
            "<p>"+str1+"<p>"
            "<input type ="text" name ="getPran" id="pra" value="+"'"+str2+"'"+"/>"
            "<input type = "submit" value ="确认" id ="submit">"+
            "<input type = "cancel" value = "取消" id = "cancel">");
    var flag = document.getElementById('submit');
    if(flag != null){
        return documnet.getElementByName("getPra");
        window.close();
    }else{
        return null;
        window.close();
    }
}



提问者:攻城狮1994 2016-07-07 17:19

个回答

  • qq_未知_3
    2016-07-07 17:42:07

    逻辑上是没有问题的