- <!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=utf-8" />
- <title>无标题文档</title>
- <script type="text/javascript" src="doctool.js"></script>
- <script type="text/javascript">
- function change()
- {
- var selNode=byId("selid");
- var value1=selNode.options[selNode.selectedIndex].value;
-
- var divNode1=byId("cssid");
- var divNode2=byId("textid");
-
- divNode1.style.textTransform = value1;
- divNode2.innerText="text tranforms : "+value1+" ;";
- }
- </script>
- <style type="text/css">
- #cssid{
- width:300px;
- height:60px;
- background:#F90;
- }
- #textid{
- width:300px;
- background:#999;
- }
- </style>
-
- </head>
- <body>
- <div id="cssid">
- Good good study, day day up!
- </div>
- <p>
- </p>
- <select id="selid" onchange="change()">
- <option name="item" value="none">----text--tranforms---</option>
- <option name="item" value="capitalize">首字母大写</option>
- <option name="item" value="uppercase">所有字母大写</option>
- <option name="item" value="lowercase">所有字母小写</option>
- </select>
- <p></p>
- <div id="textid">
- text tranform : none ;
- </div>
- </body>
- </html>
复制代码 我做出的页面,只有在第一次选择的时候会出来效果,一旦第二次选择,上面的文字格式就不会变了,这是问什么啊,求解答 |
|