You are here: Reference > JavaScript > client-side > dialog > properties > dialogTop (window)

dialogTop property (window)

Browser support:
Specifies or retrieves the top position of the dialog window.
This property is only supported by windows that were created via the window.showModalDialog or window.showModelessDialog method.


You can find the related objects in the Supported by objects section below.
This property is read/write.

Possible values:

String that sets or retrieves a floating-point number followed by a unit designator (cm, mm, in, pt, or pc, em, ex, or px).
Default: this property has no default value.

Example HTML code 1:

This example illustrates the use of the dialogTop property:
    <script type="text/javascript">
        function ShowModal () {
            if (window.showModalDialog) {
                window.showModalDialog ("dial_geom.htm", null, 
                                        "dialogWidth:300px; dialogHeight:200px; dialogLeft:310px; dialogTop:210px;");
            else {
                alert ("Your browser does not support this functionality!");
    <button onclick="ShowModal ()">Show modal dialog!</button>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content