How to open new window and specify title,toolbar,scrollbars,resizable,width,height,top,left and add HTML in JavaScript

1 Answer

0 votes
<!DOCTYPE html>
<html>
<body>

<button onclick="OpenAndAdd()">Open And Add</button>

<script>
function OpenAndAdd() {
  var w = window.open("", "Title", "toolbar=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=600,height=300,top="+(screen.height-700)+",left="+(screen.width-1000));

  w.document.body.innerHTML = "<h1>Title</h1> <p>Text text text</p>";

}
</script>

</body>
</html>

 



answered Jan 11, 2019 by avibootz

Related questions

1 answer 198 views
1 answer 226 views
226 views asked Nov 16, 2020 by avibootz
2 answers 358 views
1 answer 236 views
...