javascript里的document.all用法
1、理解document.all[]
从IE4开始IE的object model才增加了document.all[],来看看document.all[]的Description:
Array of all HTML tags in the document.Collection of all elements contained by the object.
也就是说document.all[]是文档中所有标签组成的一个数组变量,包括了文档对象中所有元素(见例1)。
IE’s document.all collection exposes all document elements.This array provides access to every element in the document.
document.all[]这个数组可以访问文档中所有元素。
例1(这个可以让你理解文档中哪些是对象)
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Document.All ExampleExample Heading
This is a paragraph. It is only a paragraph.
Yet another paragraph.
This final paragraph has special emphasis.