document屬性:
activeElement = [object]
alinkColor = #0000ff
all = [object]
anchors = [object]
applets = [object]
attributes = null
bgColor = #336699
body = [object]
childNodes = [object]
compatMode = BackCompat
cookie = style=null
defaultCharset = gb2312
dir =
doctype = null
documentElement = [object]
domain =
embeds = [object]
fgColor = #000000
fileCreatedDate = 07/04/2003
fileModifiedDate = 07/07/2003
fileSize = 5514
fileUpdatedDate =
firstChild = [object]
forms = [object]
frames = [object]
images = [object]
implementation = [object]
lastChild = [object]
lastModified = 07/07/2003 10:38:04
linkColor = #0000ff
links = [object]
location = file:///E:/文章/網(wǎng)頁對象.htm
media =
mimeType = HTML Document
nameProp = 對象屬性顯示器
namespaces = [object]
nextSibling = null
nodeName = #document
nodeType = 9
nodeValue = null
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
ownerDocument = null
parentNode = null
parentWindow = [object]
plugins = [object]
previousSibling = null
protocol = File Protocol
readyState = complete
referrer =
scripts = [object]
security = 這種類型的文檔沒有安全證書。
selection = [object]
styleSheets = [object]
title = 對象屬性顯示器
URL = file://E:\文章\網(wǎng)頁對象.htm
URLUnencoded = file://E:\文章\網(wǎng)頁對象.htm
vlinkColor = #800080
document方法:
open( )
close( )
clear( )
write( )
writeln( )
getElementById(id) 返回指定元素的引用
getElementsByName(elementName) 返回name="elementName"的所有XHTML元素對象的列表
getElementsByTagName(name) 返回文檔中所有匹配的元素的集合
createComment(da
createElement(name) 創(chuàng)建指定類型的新元素
createTextNode(text) 創(chuàng)建一個純文本結(jié)點
element方法:
getAttribute(id) 返回指定屬性的值
setAttribute(id,value) 給屬性賦值
removeAttribute(id) 移除指定屬性和它的值
getElementsByTagName(name) 返回結(jié)點內(nèi)所有匹配的元素的集合
node方法:
appendChild(child) 給指定結(jié)點添加一個新的子結(jié)點
removeChild(child) 移除指定結(jié)點的子結(jié)點
replaceChild(newChild,oldChild) 替換指定結(jié)點的子結(jié)點
insertBefore(newChild,refChild) 在同一層級的結(jié)點前面插入新結(jié)點
hasChildNodes() 如果結(jié)點有子結(jié)點則返回true
node屬性:
nodeName 以字符串的格式存放結(jié)點的名稱
nodeType 以整型數(shù)據(jù)格式存放結(jié)點的類型
nodeValue 以可用的格式存放結(jié)點的值
parentNode 指向結(jié)點的父結(jié)點的引用
childNodes 指向子結(jié)點的引用的集合
firstChild 指向子結(jié)點結(jié)合中的第一個子結(jié)點的引用
lastChild 指向子結(jié)點結(jié)合中的最后一個子結(jié)點的引用