<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Document</title> <script> window.onload=function(){ // var oSpan=document.getElementById("span"); // for(var i=3;i>0;i--){ // oSpan.innerHTML=i; // } if(window.navigator.userAgent.indexOf("MSIE") != -1){ alert("这是IE浏览器"); }else if(window.navigator.userAgent.indexOf("Chrome") != -1){ alert("这是Chrome浏览器"); }else if(window.navigator.userAgent.indexOf("Firefox") != -1){ alert("这是Firefox浏览器"); } } </script> </head> <body> <!-- <span id="span">3</span>秒后跳转 --> </body> </html>