html 动态显示元素文本

 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> 

 

 

 

posted @ 2015-08-14 19:26  jack_ou  阅读(2047)  评论(0编辑  收藏  举报