HTML and CSS Reference
In-Depth Information
JavaScript Element
Description
Text
A text node
Properties
data
The text contained within the node
length
The length in characters of the text
wholeText
The text content of the node including any adjacent text nodes before or after it
Methods
appendData(
text
)
Appends
text
to the node
deleteDate(
offset
,
count
)
Deletes
count
characters starting with the character positioned at
offset
insertData(
offset
,
count
)
Inserts
count
characters starting with the character positioned at
offset
replaceData(
offset
,
count
,
text
)
Replaces
count
characters with
text
starting with the character positioned at
offset
replaceWholeText(
text
)
Replaces the entire text of the node with
text
splitText(
offset
)
Splits the text node into two nodes at the
offset
position
substringData(
offset
,
count
)
Returns a substring starting at
offset
for
count
characters
Textareaƒ
A text area box in a Web form
Properties
cols
The number of columns of the input area
defaultValue
The default value of the text area box
enabled
A Boolean indicating whether the field is enabled
form
The form containing the text area box
name
The name of the text area box
rows
The number of rows of the input area
selectionEnd
The index of the first input character after the selected text
selectionStart
The index of the first selected character in the text area box
textLength
The length in characters of the text in the text area box
type
The type value of the text area box
value
The value of the text area box
Methods
blur()
Removes the focus from the text area box
focus()
Gives the focus to the text area box
handleEvent(
event
)
Invokes the event handler for the specified
event
select()
Selects the text area box
TextMetrics
An object containing measurements of a text string in a
CanavasRenderingContext2D
object
Properties
width
The width in pixels of the measured text
TimeRanges
A set of media time ranges
Properties
length
The length of the time ranges
Methods
end(
n
)
Returns the end time in seconds of the time range
n
start(
n
)
Returns the start time in seconds of the time range
n