moveBy method in JavaScript

moveBy() method s used to move the current window to its position.
  1. <html>
  2. <head>
  3. <script type="text/javascript">
  4. function openmywindow() {
  5. myfirstwindow = window.open('', '', 'width=100,height=100');
  6. myfirstwindow.document.write("<p>This is the example of moveBy() method in Window</p>");
  7. }
  8. function movemywindow() {
  9. myfirstwindow.moveBy(300, 300);
  10. myfirstwindow.focus();
  11. }
  12. </script>
  13. </head>
  14. <body>
  15. <input type="button" value="Open The Window" onclick="openmywindow()" />
  16. <br /><br />
  17. <input type="button" value="Move The Window" onclick="movemywindow()" />
  18. </body>
  19. </html>