How to use Window Object Focus in JavaScript
In this article I am going to explain about Window object Focus() Method in JavaScript.
JavaScript Window Object Focus() Method
JavaScript Focus() method use for focus to the user on the current open window.
Syntax
Example
<html>
<head>
<script type="text/javascript">
function myfun() {
Win = window.open('', '', 'width=350,height=75');
Win.document.write("<h5>This is my window</h5>");
Win.focus();
}
</script>
</head>
<body>
<button onclick="myfun()">
click me</button>
</body>
</html>
|
Output
You may also want to read these related articles: here
Ask Your Question
Got a programming related question? You may want to post your question here