4-7编程练习

来源:4-7 编程练习

23333_

2018-08-13 21:21:07

<!DOCTYPE html>

<html>

    <head>

        <meta charset="UTF-8">

        <title>location对象</title>

    </head>

    <body>

        <input type="button" value="打开页面" id="open">

        <script type="text/javascript">

           //补充代码

           var open1=document.getElementById("open");

           

           open1.addEventListener("click",function(){

               var input_text=prompt("输入网址:","www.imooc.com");

               if(input_text!=null)

               {

               var text='https://'+input_text;

           window.open(text,'','width=1920,height=1040');

        }

           });

    </script>

    </body>

    

</html>

代码中有可以改进的地方吗

写回答

1回答

好帮手慕查理

2018-08-14

您好,完成的很好,功能都已实现。祝学习愉快!

0

0 学习 · 4928 问题

查看课程

相似问题