DIV CSS 佈局教程網

JavaScript Document 屬性與方法整理
編輯:JavaScript基礎知識     

document 常用屬性

title 可取得或設定文件標題,URL 可取得目前網址,cookie 可讀寫 cookie,bgColor、fgColor、linkColor 等可控制顏色,charset 可設定字元集。

document 常用方法

write 可動態輸出內容,createElement 可建立元素,getElementById 可依 id 取得元素,getElementsByName 可依 name 取得元素,body.appendChild 可把新元素加入主體。

body、location 與 selection

body 可設定背景、邊距、文字與 HTML 內容。location 可取得 hash、host、hostname、href、pathname、port、protocol、search,也可用 reload、assign、replace 導頁。selection 在部分 IE 環境可用來操作選取範圍。

images 與 forms

images 集合可存取頁面圖片,forms 集合可存取表單。表單可再用 elements 或 name 取得控制項,並讀取 action、target、encoding 等屬性。

XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved