Following is the JavaScript code to reveal the Browser details. Its showing no output. Please let me know where I am doing wrong.
<html>
<head>
<title></title>
<script type="text/javascript">
var txt;
txt = "<p>Browser CodeName: " + navigator.appCodeName + "</p>";
txt+= "<p>Browser Name: " + navigator.appName + "</p>";
txt+= "<p>Browser Version: " + navigator.appVersion + "</p>";
txt+= "<p>Cookies Enabled: " + navigator.cookieEnabled + "</p>";
txt+= "<p>Platform: " + navigator.platform + "</p>";
txt+= "<p>User-agent header: " + navigator.userAgent + "</p>";
document.getElementById("example").innerHTML=txt;
</script>
</head>
<body>
<p id="example"></p>
</body>
</html>
Keep your code in after you have the
example pand it will run fine.Something like this will work. But, you should always separate your javascript from HTML.