<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style>
#divid1{
background-color:#0066FF;
height:100px;
width:300px;}
#divid2{
background-color:#CCCCCC;
width:300px;}
</style>
<script type="text/javascript">
function seldemo(){
var selNode = event.srcElement;
var value = selNode.options[selNode.selectedIndex].value;
var divNode1 = document.getElementById("divid1");
var divNode2 = document.getElementById("divid2");
divNode1.style.textTransform = value;
divNode2.innerText = "text-transform:"+value+";";
}
</script>
</head>
<body>
<div id="divid1">Good good study!Day day up!</div>
<p></p>
<select onchange="seldemo()">
<option value="none">--none--</option>
<option value="uppercase">大写</option>
<option value="lowercase">小写</option>
</select>
<p></p>
<div id="divid2">
text-transform:none;
</div>
</body>
</html>
为什么我运行在ie上的时候不能连续选大写或小写,如果是选择大写后在选择none,再选择小写这样效果是有的,但要隔一个none,选择大写之后就选小写的话,小写的效果就显示不出来,必须要在div1的区域上单击一下才能显示出来? |