window.focus() : Window Object : Window JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Window » Window Object »

 

window.focus()







The focus() method places focus on the window.












<html>
    <script language="JavaScript">
    <!--
    function openWin(){
      var myBars = 'directories=no,location=no,menubar=no,status=no';
      myBars += ',titlebar=no,toolbar=no';
      var myOptions = 'scrollbars=no,width=400,height=200,resizeable=no';
      var myFeatures = myBars + ',' + myOptions;
      newWin = open('', 'myDoc', myFeatures);
      newWin.document.writeln('Here is the child window');
      newWin.document.close();
      self.focus();
    }
    -->
    </script>
    <body>
    <form>
      <input type=BUTTON value="Open" onClick='openWin()'>
    </form>
    </body>
    </html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Window
» Window Object