javascript DOM 筆記

來源:互聯網
上載者:User

標籤:first   匹配   font   nbsp   html   nod   str   第二版   size   

以下內容來自《javasript DOM 編程藝術》第二版

 

dom中三種重要的節點:元素節點、屬性節點、文本節點。

幾種節點的重要屬性:nodeValue,nodeType(為數字1、2、3)。

子節點屬性:childNodes,firstChild=.childNodes[0],lastChild=.childNodes[.childNodes.length-1]。

.js文檔在載入完成之後立即開始執行。 p69

在html文檔全部載入完畢時將會觸發onload事件,document對象是windows對象的屬性。p69

不管什麼時候,只要是查詢dom中的某些元素,瀏覽器都會搜尋整個dom樹,從中尋找可匹配元素。所以為了提高指令碼效能,應該盡量減少訪問dom的次數。p72

 

javascript DOM 筆記

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.