document.all與WEB標準

來源:互聯網
上載者:User

1、DOM

  WEB標準現在可真是熱門中熱門,不過下面討論的是一個不符合標準的document.all[]。DOM--DOCUMENT OBJECT MODEL文件物件模型,提供了訪問文檔對象的方法.例如文檔中有一個table,你要改變它的背景顏色,那就可以在javascript中用document.all[]訪問這個TABLE。但DOM也有所不同,因為瀏覽器廠商之間的競爭,各瀏覽器廠商都開發了自己的私人DOM,只能在自己的瀏覽器上正確運行,document.all[]就是只能運行在 IE是的微軟的私人DOM。為了正確理解DOM,給出IE4的DOM

  2、理解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(這個可以讓你理解文檔中哪些是對象)

xmlns="http://www.w3.org/1999/xhtml">


Example Heading

This is a paragraph. It is only a paragraph.

Yet another paragraph.

This final paragraph has special emphasis.

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.