从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(这个可以让你理解文档中哪些是对象)
Most third-party browsers are “strict standards” implementations, meaning that they implement W3C and ECMA standards and ignore most of the proprietary object models of Internet Explorer and Netscape.If the demographic for your Web site includes users likely to use less common browsers, such as Linux aficionados, it might be a good idea to avoid IE-specific features and use the W3C DOM instead. by Internet Explorer 6, we see that IE implements significant portions of the W3C DOM. 这段话的意思是大多数第三方浏览器只支持W3C的DOM,如果你的网站用户使用其他的浏览器,那么你最好避免使用IE的私有属性。而且IE6也开始支持W3C DOM。 毕竟大多数人还不了解标准,在使用标准前,你还可以在你的网页中用document.all[]访问文档对象前面写到WEB标准,今天继续WEB标准下可以通过getElementById(), getElementsByName(), and getElementsByTagName()访问DOCUMENT中的任一个标签: 1、getElementById()
文章评论
共有 位脚本之家网友发表了评论我来说两句