HTML and CSS Reference
In-Depth Information
Table G-11 Document Object (continued)
Method
Converts
close()
Notifies the Web browser you are finished writing to a window or frame and that the
document should be displayed
createAttribute
Creates new attribute node
elementFromPoint()
Specifies which HTML element is at a point
getElementById()
Refers to an object by its specified id; id attribute values may be enclosed in single or
double quotation marks
getElementsByName()
Refers to an object by its name value; name attribute values may be enclosed in single
or double quotation marks
getElementsByTagName()
Refers to an object by its tag name; tag attribute values may be enclosed in single or
double quotation marks
getSelection()
Returns selected text
open()
Opens a window, other than the current window, and is used to update its contents
with the write() and writeln() methods
routeEvent()
Passes the captured events to the next event handler
write()
Creates new text on a Web page
writeln()
Creates new text on a Web page followed by a line break
Assigning Color to an Object
When assigning color to an object, like foreground or background, the color should
follow the red, green, blue (rgb) color scheme. The color can be written as a standard color
name, red, orange, green and so on; or the color can be represented by its hexadecimal
value of r, g, b. The hexidecimal value of the color red would be written as #ff0000, where
ff means full red, and 0000 means no green or blue. Color may also be written as an rgb()
method, where green would be written as rgb(0,255,0).
Form Object
The Form object represents forms created with the <form> ... </form> tag pair.
Table G-12 summarizes the Form object properties and methods.
Table G-12 Form Object
Property
Description
action
URL to which a form's data will be submitted
autocomplete
Browser (Boolean values: on, off) can autocomplete form controls (new in HTML5)
elements[]
Array representing a form's elements
elements.length
Number of elements on a form
encoding
Format of data being submitted
method
Method in which a form's data will be submitted (GET or POST)
name
Name of a form (Deprecated: id property is preferred)
novalidate
Boolean value indicates that form should not be validated if submitted to server CGI
(New in HTML5)
target
Window in which any results returned from the server are displayed
Method
Function
reset()
Clears any data entered into a form
submit()
Submits a form to a Web server
Search WWH ::




Custom Search