Java Reference
In-Depth Information
Property Name
Description
Introduced
readOnly
Used only if
type
is
text
or
password
. Gets or sets the value
of the
readonly
attribute.
Level 1
rows
Gets or sets the value of the
rows
attribute.
Level 1
type
Gets the value of the
type
attribute. Always set to
textarea
.
Level 1
value
Gets or sets the current value of the element.
Level 1
Methods
Method Name
Description
Introduced
blur()
Removes keyboard focus from the element.
Level 1
focus()
Gives keyboard focus to the element.
Level 1
select()
Selects the contents of the element.
Level 1
DOM Event Model and Objects
The DOM event model was introduced in DOM Level 2. It describes an event system where every event
has an event target. When an event reaches an event target, all registered event handlers on the event
target are triggered for that specifi c event. The following objects are described by the DOM event model.
EventTarget
The
EventTarget
object is inherited by all
HTMLElement
objects in the DOM. This object provides the
means for the registration and removal of event handlers on the event target.
Methods
Method Name
Description
addEventListener(type,
listener, useCapture)
Registers an event handler on an element. type is the event
type to listen for, listener is the JavaScript function to call
when the event is fi red, and useCapture determines whether
the event is captured or bubbles.
removeEventListener(type,
listener, useCapture)
Removes a listener from the element.