學習筆記:javascript 文檔對象(document)

來源:互聯網
上載者:User

標籤:element   函數   網域名稱   sre   顯示   write   modified   返回   nts   

1.documnet函數
方法 描述
close() 關閉用 document.open() 方法開啟的輸出資料流,並顯示選定的資料。
getElementById() 返回對擁有指定 id 的第一個對象的引用。
getElementsByName() 返回帶有指定名稱的對象集合。
getElementsByTagName() 返回帶有指定標籤名的對象集合。
open() 開啟一個流,以收集來自任何 document.write() 或 document.writeln() 方法的輸出。
write() 向文檔寫 HTML 運算式 或 JavaScript 代碼。
writeln() 等同於 write() 方法,不同的是在每個運算式之後寫一個分行符號。
  2.屬性
屬性 描述
body

提供對 <body> 元素的直接存取。

對於定義了框架組的文檔,該屬性引用最外層的 <frameset>。

cookie 設定或返回與當前文檔有關的所有 cookie。
domain 返回當前文檔的網域名稱。
lastModified 返迴文檔被最後修改的日期和時間。
referrer 返回載入當前文檔的文檔的 URL。
title 返回當前文檔的標題。
URL 返回當前文檔的 URL。

學習筆記:javascript 文檔對象(document)

聯繫我們

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