Window name Property - Set the name of the current window to "myWindowName": - Javascript Browser Object Model

Javascript examples for Browser Object Model:Window name

Description

Window name Property - Set the name of the current window to "myWindowName":

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 ww.  j  a v a2 s .  com
    window.name = "myWindowName";
    var x = "This window's name is now: " + window.name;
    document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>

Related Tutorials