Skip to content
Related Articles

Related Articles

Improve Article

HTML | Window name Property

  • Last Updated : 26 Jul, 2019

The Window name property is used for setting or returning the name of a window. It is generally used to modify the name of a window which has been created in the past. It returns a string which represents the name of the window.


Below program illustrates the Window name Property :

Returning the name of a window.

<!DOCTYPE html>
      Window name Property in HTML
        h1 {
            color: green;
        h2 {
            font-family: Impact;
        body {
            text-align: center;
    <h2>Window name Property</h2>
      For returning the name of the window,
      double click the "Check Name" button:
    <button ondblclick="fname()">Check Name</button>
    <! defines the name of the window -->
    <!-- property print the name of that window -->
        function fname() {
            var w ="","My Window",
                       "width=400, height=400");
            w.document.write("The name of the window is : "


After clicking the button

Supported Browsers: the browser supported by HTML | Window name Property are listed below:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Opera
  • Safari

Attention reader! Don’t stop learning now. Get hold of all the important Comcompetitivepetitve Programming concepts with the Web Design for Beginners | HTML  course.

My Personal Notes arrow_drop_up
Recommended Articles
Page :