直接在script里面换样式IE6,7,8不兼容

 1 <!DOCTYPE HTML>
 2 <html>
 3 <head>
 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 5 <title>无标题文档</title>
 6 </head>
 7 
 8 <body>
 9 
10 <input id="inp1" type="text" />
11 
12 <script>
13 var oInp = document.getElementById('inp1');
14 
15 oInp.onclick = function (){
16     
17     oInp.type = 'checkbox';
18     
19     // 咱们有仨位“祖宗”
20     /*
21         IE6 IE7 IE8
22     */
23 };
24 
25 /*
26     oDiv.style.float = 'right';
27     
28     oDiv.style.styleFloat = 'right';        // IE
29     oDiv.style.cssFloat = 'left';            // 非IE
30     
31     IE(styleFloat)
32     非IE(cssFloat)
33     
34     <div class="right"></div>
35 */
36 </script>
37 
38 </body>
39 </html>
原文地址:https://www.cnblogs.com/hduhdc/p/5250670.html