请问老师,去掉按钮环节!怎么实现?
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <script type="text/javascript"> function openWindow() { var msg = confirm('是否打开网站?'); if (msg == true) window.open('http://www.imooc.com/', '_blank', 'width=400', 'height=500'); else { window.close(); } } </script> </head> <body> <input type="button" value="新窗口打开网站" onclick="openWindow()" /> </body>