Javascript Browser Navigator appName Property get

Introduction

Get the name of your browser:

var x = "Browser Name: " + navigator.appName;

Click the button to display the name of your 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  av  a 2s  .  c om
  var x = "Browser Name: " + navigator.appName;
  document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>

The appName property returns the name of the browser.

This property is read-only.

The appName property returns a String representing the name of the browser.




PreviousNext

Related