首页 > Web开发 > 详细

html 动态显示元素文本

时间:2015-08-14 21:04:35      阅读:216      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!