<html>
<head>
<title>顯示文件屬性</title>
<SCRIPT LANGUAGE="JavaScript">
function f1() //f1:顯示
{
dis.t1.value=document.title; //文件標題
dis.t2.value=document.bgColor;//文件背景
dis.t3.value=document.lastModified;//最後修改日期
dis.t4.value=document.location; //文件位置
dis.t5.value=document.protocol; //通訊協定
}
function f2()
{
dis.t1.value="";
dis.t2.value="";
dis.t3.value="";
dis.t4.value="";
dis.t5.value="";
}
</script>
</head>
<body bgcolor="#CCFFFF">
<p align="center"><font size="4"><b>顯示文件物件的屬性</b></font></p>
<div align="center">
<center>
<table border="1" width="60%" bordercolorlight="#008000" bordercolordark="#C0C0C0">
<tr>
<td width="50%" align="center" height="22">屬性</td>
<td width="50%" align="center" height="22">值</td>
</tr>
<tr>
<td width="50%">文件標題</td>
<td width="50%">
<form name="dis">
<p><input type="text" name=t1 size="20"></p>
</td>
</tr>
<tr>
<td width="50%">背景顏色</td>
<td width="50%"><input type="text" name=t2 size="20"></td>
</tr>
<tr>
<td width="50%">網頁最後更新日期</td>
<td width="50%"><input type="text" name=t3 size="20"></td>
</tr>
<tr>
<td width="50%">檔案儲存位置</td>
<td width="50%"><input type="text" name=t4 size="20"></td>
</tr>
<tr>
<td width="50%">通訊協定</td>
<td width="50%"><input type="text" name=t5 size="20"></td>
</tr>
</form>
</table>
</center>
</div>
<p align="center">
<input type=button value="顯示相關屬性"onClick=f1()>
<input type=button value="清除相關屬性"onClick=f2()>
</p>
</body>
</html>