码迷,mamicode.com
首页 > Web开发 > 详细

html 动态显示元素文本

时间:2015-08-14 21:06:34      阅读:394      评论:0      收藏:0      [点我收藏+]

标签:

 jquery easy ui:http://www.runoob.com/jeasyui/jeasyui-dd-shopping.html

<html>   
  <head>   
  <title>dynamic show</title>   
  <meta   http-equiv="Content-Type"   content="text/html;   charset=utf-8">   
  
  </head>     
  <body onload=highlight(‘haha‘)>       
  <script>
function highlight(obj){

var selected = document.getElementById("currency");
document.getElementById("spantest").innerHTML=selected.options[selected.selectedIndex].text;

document.getElementById("ptest").style.fontSize="xx-large";
document.getElementById("ptest").style.color="red";

}
</script>
    <tr id="trtest">
        <td colspan=3 id="tdtest" name="tdtest" >
            <select id="currency" name="currency" onchange="highlight(‘haha‘)">
                <option id="op1"  value="one">1</option>
                <option id="op2"  value="two">2</option>
            </select>
        <span id="spantest" style="color:red; font-size:xx-large"></span>
        <!--p id="ptest">This is an example paragraph.</p-->
        </td>
    <tr>    
  </body>                                   
 </html> 

 

 

 

html 动态显示元素文本

标签:

原文地址:http://www.cnblogs.com/langtianya/p/4730965.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!