1.导入外部控件:
<script type="text/javascript" src="../share/My97DatePicker/WdatePicker.js" defer="defer">
</script>
在文本框种使用控件:
<input name="beginTime" type="text" id="beginTime"
class="Wdate" οnfοcus="new WdatePicker(this)"
value="单击选择开始时间"/>
2. <td width="28%" align="right" nowrap >
设置nowrap和不设置nowrap效果都一样。就是表格随着文字自动伸展,为什么?
回答问题:
TD元素noWrap属性的行为与TD元素的width属性有关。
◆如果未设置TD宽度,则noWrap属性是起作用的。
◆如果设置了TD宽度,则noWrap属性是不起作用的。
3.单击链接“清空”把beginTime文本框里的内容设为空
<a onClick="beginTime.value=''" href="javascript:void(0)">清空</a>
4. 设置表格右边框的宽度 style="border-right-width: 1px;border-bottom-width: 1px; "
5. 隐藏元素:
程序控制、显示元素:
<script type="text/javascript" >
var show = true;
function showSubMenu()
{
if(show)
{
document.getElementById("search").style.display="";
show = false;
}else
{
document.getElementById("search").style.display="none";
show = true;
}
}
</script>
点击“查询统计”将显示隐藏的id="search"的tr:
<td width="187" height="30" class="button_nav_03">
<a href="#" onClick="showSubMenu()">查询统计</a>
</td>
<tr id="search" style="display:none">
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="187" height="30" class="button_nav_02">
<a href="apply_query.html" target="content">高级查询</a>
</td>
</tr>
</table>
</td>
</tr>
6.select的值改变,触发事件,改变其他对象的值
<selectstyle="width:250"name="st_proposer_type" onChange="proposerColorChange(this.value)">
<option selected="selected" value="0">自然人</option>
<option value="1">法人</option>
<option value="2">其他</option>
</select>
function proposerColorChange(flag){
if(flag=="0"){
IDENTITY_CARD_FONT.style.color = "red";
ORG_FRAMEWORK_NO_FONT.style.color = "black";
} else if(flag == "1"){
IDENTITY_CARD_FONT.style.color = "black";
ORG_FRAMEWORK_NO_FONT.style.color = "red";
} else {
IDENTITY_CARD_FONT.style.color = "black";
ORG_FRAMEWORK_NO_FONT.style.color = "black";
}
}