JS在ff和ie区别(未完,待续...)
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<title>JS在ff和ie区别</title>
<style>
*{margin:0;padding:0;}
.test3{ width:100px; height:100px; background-color:#f00}
</style>
</head>
<body>
<select id="sel" class="test1"></select>
<label for="test2" id="lb"></label>
<div class="test3" id="odiv"></div>
<script>
var foo=document.getElementById('sel');
var foo2=document.getElementById('lb');
var foo3=document.getElementById('odiv');
alert(foo.getAttribute('class')) //w3c
alert(foo.getAttribute('className')) //IE6 7
alert(foo2.getAttribute('for')) //w3c
alert(foo2.getAttribute('htmlFor')) //IE6 7
foo3.style.cssFloat='right' //w3c
foo3.style.styleFloat='right' //IE
foo3.style.opacity='0.5'; //w3c
foo3.style.filter='alpha(opacity=50)' //IE
if(!!document.all){
alert('IE brower')
}else{
alert('not IE brower')
}
</script>
</body>
</html>
<html>
<head>
<meta charset="UTF-8"/>
<title>JS在ff和ie区别</title>
<style>
*{margin:0;padding:0;}
.test3{ width:100px; height:100px; background-color:#f00}
</style>
</head>
<body>
<select id="sel" class="test1"></select>
<label for="test2" id="lb"></label>
<div class="test3" id="odiv"></div>
<script>
var foo=document.getElementById('sel');
var foo2=document.getElementById('lb');
var foo3=document.getElementById('odiv');
alert(foo.getAttribute('class')) //w3c
alert(foo.getAttribute('className')) //IE6 7
alert(foo2.getAttribute('for')) //w3c
alert(foo2.getAttribute('htmlFor')) //IE6 7
foo3.style.cssFloat='right' //w3c
foo3.style.styleFloat='right' //IE
foo3.style.opacity='0.5'; //w3c
foo3.style.filter='alpha(opacity=50)' //IE
if(!!document.all){
alert('IE brower')
}else{
alert('not IE brower')
}
</script>
</body>
</html>