Navigator platform Property - Javascript Browser Object Model

Javascript examples for Browser Object Model:Navigator

Description

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>
<html>
<body>

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

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

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

</body>
</html>

Related Tutorials