Document-對象屬性和常用的對象方法


Document-對象屬性和常用的對象方法

對象屬性

document.title                                  //設置文檔標題等價於HTML的title標簽

document.bgColor                                //設置頁面背景色

document.fgColor                                //設置前景色(文本顏色)

document.linkColor                                //未點擊過的鏈接顏色

document.alinkColor                                //激活鏈接(焦點在此鏈接上)的顏色

document.vlinkColor                                //已點擊過的鏈接顏色

document.URL                                   //設置URL屬性從而在同一窗口打開另一網頁

document.fileCreatedDate                            //文件建立日期,只讀屬性

document.fileModifiedDate                           //文件修改日期,只讀屬性

document.fileSize                                //文件大小,只讀屬性

document.cookie                                 //設置和讀出cookie

document.charset                               //設置字符集 簡體中文:gb2312

———————————————————————

常用對象方法

document.write()                                               //動態向頁面寫入內容

document.createElement(Tag)                                         //創建一個html標簽對象

document.getElementById(ID)                                        //獲得指定ID值的對象

document.getElementsByName(Name)                                      //獲得指定Name值的對象

document.getElementsByClassName(“className”)                      //獲得指定class值的對象(數組)

document.getElementsByTagName(“TagName”)                         //獲得指定Tag對象

document.body.appendChild(oTag)

———————————————————————

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM