You are here: Reference > JavaScript > client-side > browser > properties > platform (clientInformation, navigator)

platform property (clientInformation, navigator)

Browser support:
Returns the name of the operating system platform.

Syntax:

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

Possible values:

String that retrieves the type of system platform.
One of the following values:
HP-UX
Unix system.
Mac68K
Macintosh 68K system.
MacPPC
Macintosh PowerPC system.
SunOS
Solaris system.
Win16
Windows 16-bit system.
Win32
Windows 32-bit system.
WinCE
Windows CE system.
Default: this property has no default value.

Example HTML code 1:

This example illustrates the use of the platform property:
<head>
    <script type="text/javascript">
        function GetCpuOs () {
            if (navigator.cpuClass) {
                alert ("CPU class: " + navigator.cpuClass);
            } else if (navigator.oscpu) {
                alert ("CPU class: " + navigator.oscpu);
            }
            alert ("System platform: " + navigator.platform);
        }
    </script>
</head>
<body>
    <button onclick="GetCpuOs ();">Get the CPU and OS!</button>
</body>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content