|
23 Browser Object Model
---------
Browser
Object
Model
---------------------------------------------------------------------
Window
-
Navigator
-
Frames
-
Location
-
History
-
Screen
-
Document
location
applets
images
anchors
embeds
links
plugins
stylesheets
forms
form
button
text
reset
text area
password
select
options
radio
checkbox
submit
hidden
fileupload
---------
Properties and Methods
---------------------------------------------------------------------
Window Document Forms
Properties Methods Properties Methods Properties Methods
closed alert() alinkColor clear() action submit()
defaultStatus blur() anchors open() elements reset()
document clearInterval() applets close() enctype
frames clearTimeout() bgColor write() length
history close() cookie writeln() method
location focus() domain setInterval() name
name moveBy() embeds clearInterval() target
navigator moveTo() fgColor setTimeout()
opener open() forms clearTimeout()
parent prompt() images
parent resizeTo() lastModified
screen scroll() linkColor
status scrollTo() links
top confirm() location
plugins
referrer
title
URL
vlinkColor
????
menubar
-
include File, Edit, ... etc.
scrollbars
-
resizable
-
when available, window can be resized
width
-
width of the window
in
pixels.
height
-
height of the window
in
pixels.
toolbar
-
browser toolbar, which contains the Back, Forward, Stop ... buttons
location
-
text area of a browser into which you can type URLs.
Referencing Forms and Elements
---------------------------------------
Forms
window.document.forms[index]
window.document.forms[
"name"
]
window.documents.forms.name
window.document.name
Elements
form.elements[index]
form.elements[
"name"
]
form.name
Elements of a form
------------------------------------------
command buttons
submit, reset, button
text elements
text
password
fileupload
textarea
hidden
buttons
radio
checkbox
lists
select (single)
select (multiple)
option
Form Element Properties
/
Methods
/
Events
------------------------
Common properties of elements
:
form, name, type
text
Property
:
value
Methods
:
blur, focus, handleEvent, select
Events
:
blur, change, focus, select, keydown, keypress, keyup
textarea
Property
:
value
Methoods
:
blur, focus, handleEvent, select
Events
:
keydown, keypress, keyup
password
Property
:
value
Methoods
:
blur, focus, handleEvent, select
Events
:
keydown, keypress, keyup
fileupload
Property
:
value
Methoods
:
blur, focus, handleEvent, select
Events
:
blur, change, focus
hidden
Property
:
value
Methoods
:
-
Events
:
-
checkbox
Property
:
checked, value, checked
Methoods
:
click, handleEvent
Events
:
click, mouseDown, mouseUp
radio
Property
:
checked, value, length
Methoods
:
click, handleEvent
Events
:
click, mouseDown, mouseUp
select
Property
:
length, options, selectedIndex
Methoods
:
blur, focus, handleEvent
Events
:
blur, change, focus
option
Property
:
index, selected, text, value
Methoods
:
-
Events
:
-
|