js兼容性之css的float

来源:互联网 发布:八爪鱼抓取淘宝评论 编辑:程序博客网 时间:2024/06/03 19:06

此代码转载至妙味课堂的教学,仅用于个人学习记录。

<!DOCTYPE HTML>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
</head>


<body>


<input id="inp1" type="text" />


<script>
var oInp = document.getElementById('inp1');


oInp.onclick = function (){

oInp.type = 'checkbox';

// 咱们有仨位“祖宗”
/*
IE6 IE7 IE8
*/
};


/*
oDiv.style.float = 'right';

oDiv.style.styleFloat = 'right';// IE
oDiv.style.cssFloat = 'left';// 非IE

IE(styleFloat)
非IE(cssFloat)

<div class="right"></div>
*/
</script>


</body>
</html>
0 0
原创粉丝点击