Content handling properties and methods in JavaScript
Related properties:
Property | Support | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
_content (window) |
Returns a reference to the topmost ancestor window object in the window hierarchy. | |||||||||||
canHaveHTML | Retrieves a Boolean value that indicates whether the element can contain HTML formatted text. | |||||||||||
content (window) |
Returns a reference to the topmost ancestor window object in the window hierarchy. | |||||||||||
contentEditable |
|
Sets or retrieves whether the contents of the object are editable. | ||||||||||
contentDocument (applet, frame, iframe, object) |
|
Retrieves the document generated by a frame or iframe element. | ||||||||||
contentWindow (frame, iframe) |
Retrieves the window generated by a frame or iframe element. | |||||||||||
data (comment, CommentNode, TextNode) |
Sets or returns the text content of a CommentNode, TextNode or comment element. | |||||||||||
defaultValue (input, textarea, ...) |
Specifies or returns the initial value of the object. The initial state can be set with the value attribute in HTML. | |||||||||||
files (input:file) |
|
Returns a FileList collection that represents the file or files selected with the current input:file element. | ||||||||||
innerHTML | Sets or retrieves the inner HTML content (the source code between the opening and closing tags) of an element. | |||||||||||
innerText | Sets or returns the text content of an element including the text content of its descendants. | |||||||||||
isContentEditable | Returns a Boolean value that indicates whether the contents of the object are editable by the user. | |||||||||||
isElementContentWhitespace (TextNode) |
Returns a Boolean value that indicates whether the current TextNode only contains whitespaces. | |||||||||||
nodeName | Returns the name of the current node. | |||||||||||
nodeType | Returns an integer that indicates the type of the node. | |||||||||||
nodeValue | Sets or returns the value of the current node. | |||||||||||
outerHTML | Sets or retrieves the outer HTML content (the source code including the opening and closing tags) of an element. | |||||||||||
outerText | Sets or returns the text content of an element including the text content of its descendants. | |||||||||||
parentTextEdit | Returns the closest ancestor element of the current element in the DOM hierarchy that can be used to create a TextRange object. | |||||||||||
text (optgroup, option) |
Sets or returns a string that represents the text of an option element. | |||||||||||
text (script, title, CommentNode, ...) |
Sets or returns a string that corresponds the contents of the element. | |||||||||||
textContent |
|
Sets or returns the text content of an element including the text content of its descendants. | ||||||||||
value (input, isindex, textarea, ...) |
Specifies or returns the value of the control. | |||||||||||
value (input:file) |
Returns a string that contains the path or the name of the file or files selected with the current input:file element. | |||||||||||
value (li) |
Specifies or returns the number of a list item. | |||||||||||
value (keygen, option, select) |
Specifies or returns the value of an option or a select element. |
Related methods:
Method | Support | Description | |||||
---|---|---|---|---|---|---|---|
appendData (comment, CommentNode, TextNode) |
Appends the specified text content to the end of the current TextNode, CommentNode or comment element. | ||||||
deleteData (comment, CommentNode, TextNode) |
Removes the specified part of the text content of the current TextNode, CommentNode or comment element. | ||||||
insertAdjacentHTML | Inserts a HTML formatted text at the specified position relative to the current element. | ||||||
insertAdjacentText | Creates a new TextNode from the specified text and inserts it at the specified position relative to the current element. | ||||||
insertData (comment, CommentNode, TextNode) |
Inserts text content into the current TextNode, CommentNode or comment element at the specified position. | ||||||
open (document) |
Opens a document stream for writing. | ||||||
open (window) |
Creates a new window and loads the specified document into it. | ||||||
replaceData (comment, CommentNode, TextNode) |
Replaces the specified part of the text content of the current TextNode, CommentNode or comment element with a new text. | ||||||
splitText (TextNode) |
Breaks the current TextNode object into two TextNode objects at the specified index. | ||||||
substringData (comment, CommentNode, TextNode) |
Returns the part of the current element's text content from the specified position with the specified length. | ||||||
write (document) |
Writes a string into the document stream. | ||||||
writeln (document) |
Writes a string followed by a new line character into the document stream. |
User Contributed Comments