Window open() Method - Open a new window. Use the name property to return the name of the new window: - Javascript Browser Object Model

Javascript examples for Browser Object Model:Window open

Description

Window open() Method - Open a new window. Use the name property to return the name of the new window:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<button onclick="myFunction()">Test</button>

<p id="demo"></p>

<script>
function myFunction() {/*from w w w .  jav  a2s.c o m*/
    window.name = "myWindowName";
    var x = "This window's name is now: " + window.name;
    document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>

Related Tutorials