You are here: Reference > JavaScript > client-side > dialog > properties > document (popup)

document property (popup)

Browser support:
Returns a reference to the document object in a popup window.

Syntax:

object.document;
You can find the related objects in the Supported by objects section below.
This property is read-only.

Possible values:

Reference to the document object.
Default: this property has no default value.

Example HTML code 1:

This example illustrates the use of the document property:
<head>
    <script type="text/javascript">
        var popupWindow = null;
        function MakePopup () {
            if (window.createPopup) {        //Internet Explorer
                if (!popupWindow) {
                    popupWindow = window.createPopup ();
                    var popupBody = popupWindow.document.body;
                    popupBody.style.backgroundColor = "lightblue";
                    popupBody.style.border = "solid black 1px";
                    popupBody.innerHTML = "Click outside to close.";
                }
                popupWindow.show (100, 100, 150, 25, document.body);
            }
            else {
                alert ("Your browser does not support this example!");
            }
        }
    </script>
</head>
<body>
    <input type="button" value="Create a popup window!" onclick="MakePopup ();"/>
</body>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content