JS HTML DOM[转]
JS HTML DOM
w3pop.com / 2006-09-22
In addition to the built-in JavaScript objects, you can also access and manipulate all of the HTML DOM objects with JavaScript.
除了JS内置的对象外,你还可以通过JS来访问和操作所有的HTML DOM对象。
The HTML DOM
The HTML DOM is a W3C standard and it is an abbreviation for the Document Object Model for HTML.
HTML DOM是W3C的一个标准 ,它是HTML文档对象模型(Document Object Model)的简称
The HTML DOM defines a standard set of objects for HTML, and a standard way to access and manipulate HTML documents.
HTML DOM定义了一套标准的HTML对象,并且用标准的方法来访问和操作HTML文档
All HTML elements, along with their containing text and attributes, can be accessed through the DOM. The contents can be modified or deleted, and new elements can be created.
使用DOM可以访问HTML所有的元素以及其内的文字和属性。内容可以修改和删除,并且能建立新的元素。
The HTML DOM is platform and language independent. It can be used by any programming language like Java, JavaScript, and VBScript.
HTML DOM是一个独立的平台和语言。可以使用任何程序语言,像JAVA,JS,VBS
Follow the links below to learn more about how to access and manipulate each DOM object with JavaScript:
跟随下面的连接来学习更多有关使用JS访问并操作每个DOM对象
------以下的内容就是DOM教程--------
对象 | 描述 |
---|---|
Anchor | Represents an HTML a element (a hyperlink) 代表了HTML的 a 元素 (超级链接) |
Applet | Represents an HTML applet element. The applet element is used to place executable content on a page 代表了HTML的applet元素,applet元素可用来放置页面内可执行的内容 |
Area | Represents an area of an image-map. An image-map is an image with clickable regions 代表了图象映射区域。带有可点击的图片可称为图象映射 |
Base | Represents an HTML base element 代表了HTML的 base元素 |
Basefont | Represents an HTML basefont element HTML的basefont元素 |
Body | Represents the body of the document (the HTML body) 文档的主体(body) |
Button | Represents a push button on an HTML form. For each instance of an HTML <input type="button"> tag on an HTML form, a Button object is created HTML表单上的按钮。HTML表单中只要出现了<input type="button">标签,一个Button对象就建立了 |
Checkbox | Represents a checkbox on an HTML form. For each instance of an HTML <input type="checkbox"> tag on an HTML form, a Checkbox object is created HTML表单中的复选框。只要HTML表单中出现了<input type="checkbox">标签,就会建立起Checkbox对象 |
Document | Used to access all elements in a page 可用来访问所有在页面中的元素 |
Event | Represents the state of an event, such as the element in which the event occurred, the state of the keyboard keys, the location of the mouse, and the state of the mouse buttons 代表事件的状态,比如某个元素的事件发生了,键盘按键的状态,鼠标的位置,鼠标按钮的状态 |
FileUpload | For each instance of an HTML <input type="file"> tag on a form, a FileUpload object is created 当HTML表单中有<input type="file">,FileUpload对象就建立起来了 |
Form | Forms are used to prompt users for input. Represents an HTML form element 表单可用于用户信息的输入递交。可代表HTML中的form元素 |
Frame | Represents an HTML frame 代表了HTML中的框架 |
Frameset | Represents an HTML frameset HTML的框架集 |
Hidden | Represents a hidden field on an HTML form. For each instance of an HTML <input type="hidden"> tag on a form, a Hidden object is created 在HTML中的隐藏区域。每当HTML表单中出现<input type="hidden">标签,Hidden对象就建立起来了 |
History | A predefined object which can be accessed through the history property of the Window object. This object consists of an array of URLs. These URLs are all the URLs the user has visited within a browser window 通过Window对象的history属性所访问的预先确定对象。这个对象由一组URLs所构成。这些URLs是所有用户曾经在浏览器中访问过的URLs。 |
Iframe | Represents an HTML inline-frame HTML中的内联框架 |
Image | Represents an HTML img element HTML的img元素 |
Link | Represents an HTML link element. The link element can only be used within the <head> tag HTML的link元素。只能在<head>标签里使用link元素 |
Location | Contains information about the current URL 含有当前URL的信息 |
Meta | Represents an HTML meta element HTML的meta元素 |
Navigator | Contains information about the client browser 含有客户端信息 |
Option | Represents an option in a selection list on an HTML form. For each instance of an HTML <option> tag in a selection list on a form, an Option object is created 在HTML表单中的选择项。每当HTML表单中出现<option>标签,Option对象就建立了 |
Password | Represents a password field on an HTML form. For each instance of an HTML <input type="password"> tag on a form, a Password object is created |
Radio | Represents radio buttons on an HTML form. For each instance of an HTML <input type="radio"> tag on a form, a Radio object is created |
Reset | Represents a reset button on an HTML form. For each instance of an HTML <input type="reset"> tag on a form, a Reset object is created |
Screen | Automatically created by the JavaScript runtime engine and it contains information about the client's display screen |
Select | Represents a selection list on an HTML form. For each instance of an HTML <select> tag on a form, a Select object is created |
Style | Represents an individual style statement. This object can be accessed from the document or from the elements to which that style is applied |
Submit | Represents a submit button on an HTML form. For each instance of an HTML <input type="submit"> tag on a form, a Submit object is created |
Table | Represents an HTML table element |
TableData | Represents an HTML td element |
TableHeader | Represents an HTML th element |
TableRow | Represents an HTML tr element |
Text | Represents a text field on an HTML form. For each instance of an HTML <input type="text"> tag on a form, a Text object is created |
Textarea | Represents an HTML textarea element |
Window | Corresponds to the browser window. A Window object is created automatically with every instance of a <body> or <frameset> tag |