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";
}
}