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.body.appendChild(oTag)
———————————————————————
?
?
轉載于:https://www.cnblogs.com/z-jun/p/6007127.html
總結
以上是生活随笔為你收集整理的Document-对象属性和常用的对象方法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ZOJ.3551.Bloodsucker
- 下一篇: poj 3071 Football