Javascript Navigator get user agent and platform

Description

Javascript Navigator get user agent and platform

View in separate window

<!DOCTYPE html>
<head>
<title>Recipe</title>
<script>
  window.onload = function() {/* w w  w . j av  a2  s. c  o  m*/

    let browser = navigator.userAgent;
    let info = "<p>Browser: " + browser + "</p>";

    let platform = navigator.platform;
    info += "<p>Platform: " + platform + "</p>";

    document.getElementById("output").innerHTML = info;
  }
</script>

</head>
<body>
  <div id="output"></div>
</body>
</html>



PreviousNext

Related