Javascript 如何使用Html代码检测我的浏览器版本和操作系统?

Javascript 如何使用Html代码检测我的浏览器版本和操作系统?,javascript,jquery,css,html,Javascript,Jquery,Css,Html,代码应显示在浏览器输出中,如 浏览器名称:Netscape 浏览器版本:5.0 平台/操作系统:Win32/linux/mac你不能使用CSS,但可以使用JavaScript txt=“浏览器代码名:”+navigator.appCodeName+“”; txt+=“浏览器名称:”+navigator.appName+“”; txt+=“浏览器版本:”+navigator.appVersion+“”; txt+=“Cookies已启用:”+navigator.cookieEnabled+“”

代码应显示在浏览器输出中,如

浏览器名称:Netscape

浏览器版本:5.0
平台/操作系统:Win32/linux/mac

你不能使用CSS,但可以使用JavaScript


txt=“浏览器代码名:”+navigator.appCodeName+“

”; txt+=“浏览器名称:”+navigator.appName+“

”; txt+=“浏览器版本:”+navigator.appVersion+“

”; txt+=“Cookies已启用:”+navigator.cookieEnabled+“

”; txt+=“平台:“+navigator.Platform+”

”; txt+=“用户代理标题:“+navigator.userAgent+”

”; txt+=“用户代理语言:”+navigator.systemLanguage+“

”; console.log(txt);
这里已经给出了答案:如果您真的需要这些信息,那么很难找到可能的重复信息——您想做什么?
<script>

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>";
txt+= "<p>User-agent language: " + navigator.systemLanguage + "</p>";

console.log(txt);

</script>