VOOZH about

URL: https://www.geeksforgeeks.org/html/html-dom-navigator-useragent-property/

⇱ HTML DOM Navigator userAgent Property - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

HTML DOM Navigator userAgent Property

Last Updated : 14 Jun, 2023

The Navigator userAgent property is used for returning the user-agent header's value sent to the server by the browser. It returns a string representing values such as the name, version, and platform of the browser.

Syntax: 

navigator.userAgent

Return Value: A String, representing the user agent string for the current browser

Below program illustrates the Navigator userAgent Property:  

Output: 
Before clicking the button:

👁 Image

After clicking the button: 

👁 Image

Supported Browsers: The browser supported by Navigator userAgent are listed below:  

  • Google Chrome 1
  • Edge 12
  • Internet Explorer 4
  • Firefox 1
  • Opera 12.1
  • Safari 1
Comment
Article Tags: