self.close в buttone со свойствами submit неработает Вот код Код (Text): <script type="text/javascript"> name = 'Это я его открыло!'; var win; /* НОВОЕ ОКНО! */ function winOpen() { var w = 300, h = 500, l = (screen.width - w) / 2, t = (screen.height - h) / 2, p = "width="+w+", height="+h+", top="+t+", left="+l; win = window.open("", "", p); win.focus(); docWrite() } function winClose() { if( win && !win.closed ){ win.focus(); win.close(); } } function docWrite() { if( win && !win.closed ){ win.focus(); var text = ""; text+='<div class="orderForm" style="left:0px;top:0px;background:blue;">'; text+='<form action="mail.php" method="post">'; text+='<fieldset>'; text+='<link rel="stylesheet" href="css/style.css">'; text +='<p><label for="name">Имя*</label></p>'; text+='<p><input type="text" name="name" id="name" required></p>'; text +='<p><label for="city">Город</label></p>'; text+='<p><input type="text" name="city" id="city"></p>' text +='<p><label for="email">E-mail*</label></p>'; text+='<p><input type="email" name="email" id="email" required></p>' text +='<p><label for="phone">Телефон*</label></p>'; text+='<p><input type="text" name="phone" id="phone" required></p>'; text +='<p><label for="company">Сайт компании</label></p>'; text+='<p><input type="text" name="site" id="company"></p>'; text+='<button class="btn btn-primary btn-lg" type="submit" value="Отправить" name="submit" href="javascript:self.close();">Отправить заявку</button>'; text+='</fieldset>'; text+='</form>'; text+='</div>'; win.document.open(); win.document.write(text); win.document.close(); } </script> </head> <body> <p class="p1"><a href="javascript:winOpen();">Открыть окно</a></p> <p class="p3"><a href="javascript:docWrite();">Заполнить окно</a></p> <p class="p2"><a href="javascript:winClose();">Закрыть окно</a></p> </body> </html> как исправить