JS DOM: Get User Agent, Cookie Enabled Status
Here is how to find the browser (User Agent) used, and Cookie Enabled Status.
The object navigator
stores info about browser.
your browser status
- navigator.userAgent:
- navigator.cookieEnabled:
code
<ul> <li><b>navigator.userAgent:</b> <span id="xuserAgent"></span></li> <li><b>navigator.cookieEnabled:</b> <span id="xcookieEnabled"></span></li> </ul>
{ document.getElementById("xuserAgent").textContent = navigator.userAgent; document.getElementById("xcookieEnabled").textContent = navigator.cookieEnabled; }