DropDownList调用javascript控制表格行tr的显示与隐藏
DropDownList调用javascript控制表格行tr的显示与隐藏
<mce:script language="javascript"><!--
function cao() {
if(document.all.ddl_class.value=="0")
{
hongtou.style.display="none";
wailai.style.display="none";
wailai1.style.display="none";
}
else if(document.all.ddl_class.value=="1")
{
hongtou.style.display="block";
wailai.style.display="none";
wailai1.style.display="none";
}
else
{
hongtou.style.display="none";
wailai.style.display="block";
wailai1.style.display="block";
}
}
// --></mce:script>
<asp:DropDownList ID="ddl_class" runat="server" onchange="cao()">
<asp:ListItem Value="0">新建文件</asp:ListItem>
<asp:ListItem Value="1">红头文件</asp:ListItem>
<asp:ListItem Value="2">外来文件</asp:ListItem>
</asp:DropDownList>
<table>
<tr id="hongtou" style="DISPLAY:none" mce_style="DISPLAY:none">
<td>份数:</td>
<td></td>
</tr>
<tr id="wailai" style="DISPLAY:none" mce_style="DISPLAY:none">
<td>来文(电)单位:</td>
<td></td>
</tr>
<tr id="wailai1" style="DISPLAY:none" mce_style="DISPLAY:none">
<td>联系人:</td>
<td></td>
</tr>
</table>
相关文档:
page1.html为父窗口,page2.htm为子窗口。详细代码如下:
page1.html
引用
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Con ......
不知道怎么回事,以前用setTimeout没出过问题,这次怎么用都错
代码:
window.onload=function(){
function x(){
alert("s");
}
setTimeout("x()",1000);
}
把window.onload=function(){}去掉就能用了,但是这样写惯了,而且去掉之后,像document.getElementById这样的方法会找不到对象, ......
在JavaScript里,字面量包括:字符串字面量,数组字面量,函数字面量和对象字面量。
1.字符串字面量
var str = "Hello World!";
&ldquo ......
Chrome 拥有更快速的JavaScript;
编写如下小程序:
<html>
<script language = "javascript">
var sum = 0;
var start = new Date;
for(var i = 0; i < 1000001; i++){
sum+=i;
}
var stop = new Date;
document.write("从1到1000000的累加结果:" + sum + ";" + "<br/> ......
以下是test.htm页的内容
首先定义一个插件对象
<object id="Mapupload" name="Mapupload" width="0" height="0" classid="clsid:045FA9B9-B373-4D4C-AE76-128A19A4B6AE">
</object>
<script type="text/javascript">
//此函数打开activexform窗体并为activ ......