C# Corner
Tech
News
Videos
Forums
Trainings
Books
Events
More
Interviews
Jobs
Live
Learn
Career
Members
Blogs
Challenges
Certifications
Bounties
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Browser Detection In JavaScript
WhatsApp
Mahak Gupta
5y
4.7
k
0
0
25
Blog
Browser Detection In JavaScript
We can Detect the visitor's browser with the help of Navigator Object In JavaScript.
Ex:
<html>
<body>
<div id=
"browserdetection"
></div>
<script type=
"text/javascript"
>
x =
"<p>Browser CodeName: "
+ navigator.appCodeName +
"</p>"
;
x +=
"<p>Browser Name: "
+ navigator.appName +
"</p>"
;
x +=
"<p>Cookies Enabled: "
+ navigator.cookieEnabled +
"</p>"
;
x +=
"<p>Browser Version: "
+ navigator.appVersion +
"</p>"
;
document.getElementById(
"browserdetection"
).innerHTML = x;
</script>
</body>
</html>
Output:
People also reading
Membership not found