Javascript Browser Navigator platform Property

Introduction

Get the version of your browser:

var x = "Platform: " + navigator.platform;

Click the button to display the platform of the browser.

View in separate window

<!DOCTYPE html>
<html>
<body>
<button onclick="myFunction()">Test</button>

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

<script>
function myFunction() {//from ww w  . j ava2  s . c om
  var x = "Platform: " + navigator.platform;
  document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>

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

The platform property returns a String representing platform of the browser.




PreviousNext

Related