android-logo

JavaScript Navigator


The Navigator object has attributes that give information from the browser. You may access the navigator object by window.navigator or navigator.


Lets take an example to check browser is connected to the Internet


<!DOCTYPE html>
<html>
<body>
<p id="show"></p>

 <script>
    let Online = window.navigator.onLine;
    document.getElementById("show").innerHTML = "Browser Online: " + Online;
 </script>

</body>
</html>

// Output- Browser Online: true


Get Browser Language


<!DOCTYPE html>
<html>
<body>
<p id="show"></p>

 <script>
    let language = window.navigator.language;
    document.getElementById("show").innerHTML = "Browser Language: " + language;
 </script>

</body>
</html>        

// Output- Browser Language: en-US

PropertyDescription
appCodeNameGet browser code name
appNameGet browser name
appVersionGet browser version
cookieEnabledCheck if cookies are enabled
languageGet browser language
onLineCheck if browser is online
platformGet browser platform
productGet browser engine name
storageGet StorageManager object
mediaDevicesGet available media devices
locksGet LockManager object
javaEnabledChecks if the browser has Java enabled.
batteryGet BatteryManager object

previous-button
next-button

facebook-logo
twitter-logo
instagram-logo

2020 © All rights reserved.