注:页面上元素name属性和JavaScript引用的名称必须一致包括大小写
---------------------------------------------------------------------
对象属性
document.title
document.bgColor
document.fgColor
document.linkColor
document.alinkColor
document.vlinkColor
document.URL
document.fileCreatedDate
document.fileModifiedDate
document.fileSize
document.cookie
document.charset
---------------------------------------------------------------------
对象方法
document.write()
document.createElement_x(Tag)
document.getElementByIdx_x(ID)
document.getElementsByName(Name)
---------------------------------------------------------------------
images 集合(页面中的图象)
a) 通过集合引用
document.images
document.images.length
document.images[0]
document.images[i]
b) 通过nane属性直接引用
<img name="oImage">
document.images.oImage
c) 引用图片的src属性
document.images.oImage.src
d) 创建一个图象
var oImage
oImage = new Image()
document.images.oImage.src="/1.jpg"
// 同时在页面上建立一个<img>标签与之对应就可以显示
<html>
<img name=oImage>
<script language="javascript">
</script>
</html>
----------------------------------------------------------------------
forms 集合(页面中的表单)
a) 通过集合引用
document.forms
document.forms.length
document.forms[0]
document.forms[i]
document.forms[i].length
document.forms[i].elements[j]
b) 通过标签name属性直接引用
<form name="Myform"><input name="myctrl"></form>
document.Myform.myctrl
-----------------------------------------------------------------------
<html>
<!--Text 控件相关Script-->
<form name="Myform">
<input type="text" name="oText">
<input type="password" name="oPswd">
<form>
<script language="javascript">
// 获取文本密码框的值
document.write(document.Myform.oText.value)
document.write(document.Myform.oPswd.value)
</script>
</html>
-----------------------------------------------------------------------
<html>
<!--Select 控件相关Script-->
<form name="Myform">
<select name="oSelect">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</form>
<script language="javascript">
</script>
<script language="javascript">
</script>
<script language="javascript">
</script>
<script language="javascript">
</script>
<html>
-----------------------------------------------------------------------
<Div id="oDiv">Text</Div>
document.all.oDiv
document.all.oDiv.style
document.all.oDiv.style.display=""
document.all.oDiv.style.display="none"