Navigator platform Property - Javascript Browser Object Model

Javascript examples for Browser Object Model:Navigator


The platform property returns for which platform the browser is compiled.

Return Value

A String, representing platform of the browser.

The following code shows how to get the platform of your browser:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>

<button onclick="myFunction()">Test</button>

<p id="demo"></p>

function myFunction() {// w w  w .j ava 2  s .  com
    var x = "Platform: " + navigator.platform;
    document.getElementById("demo").innerHTML = x;


Related Tutorials