You are here: Reference > JavaScript > client-side > HTML DOM > properties > systemId (doctype)

systemId property (doctype)

Browser support:
Returns the system identifier portion of the doctype element.

Syntax:

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

Possible values:

String that represents the system identifier.
Default: this property has no default value.

Example HTML code 1:

This example illustrates the use of the systemId property:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
    <head>
        <script type="text/javascript">
            function GetDocType () {
                if (document.doctype) {
                    var docTypeName = document.doctype.name;
                    var pubIdStr = document.doctype.publicId;
                    var sysIdStr = document.doctype.systemId;

                    var message = "Document type: " + docTypeName;
                    message += "\nDOCTYPE publicId: " + pubIdStr;
                    message += "\nDOCTYPE systemId: " + sysIdStr;
                    alert (message);
                }
                else {
                    alert ("Your browser does not support this example!");
                }
            }
        </script>
    </head>
    <body>
        <button onclick="GetDocType ();">Get DOCTYPE properties!</button>
    </body>
</html>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content