//-----------innerHTML-----------------
<table>
<tr>
<td id="contants">aaaaaa
<input type="button" onclick="a()" value="点击">
</td>
</tr>
</table> 
<script>...
function a() 
...{
contants.innerHTML="<font style="font-size: 11pt">abc</font>" ;
}
</script> 
//------------------innerText--------------
<div id="clock">这是一个层</div> 
<script language="javascript">...
function test() 
...{
var timevalue=new Date()
document.all.clock.innerText=timevalue;
}
</script>
<input type="button" value="设置" onclick="test()">
<input type="button" value="获取" Onclick="alert(clock.innerText)">
//DropDownList 添加客户端事件
<asp:DropDownList ID="DropDownList1" runat="server" onchange ="aa(this.options[this.selectedIndex].innerText)">
<asp:ListItem>11</asp:ListItem>
<asp:ListItem>22</asp:ListItem>
</asp:DropDownList></div>
//生成的页面代码
</div>
<div>
<select name="DropDownList1" id="DropDownList1" onchange="aa(this.options[this.selectedIndex].innerText)">
<option value="11">11</option>
<option value="22">22</option>
</select></div>

本文介绍如何使用HTML和JavaScript实现按钮点击事件,改变页面元素的显示内容,并通过DropDownList的客户端事件来响应用户的交互操作。
1085

被折叠的 条评论
为什么被折叠?



