CharacterData
A interface abstrata CharacterData representa um objeto Node
que contém caracteres. Esta é uma interface abstrata, o que significa que não há nenhum objeto do tipo CharacterData
: ela é implementada por outras interfaces, como Text
(en-US), Comment
(en-US) ou ProcessingInstruction
, que não são abstratas.
Propriedades
Herda propriedades de seu pai, Node
, e implementa as interfaces ChildNode
e NonDocumentTypeChildNode
(en-US).
CharacterData.data
(en-US)-
É um
DOMString
representando os dados textuais contidos neste objeto. CharacterData.length
(en-US) Somente leitura-
Retorna um
unsigned long
representando o tamanho da string contida emCharacterData.data
. NonDocumentTypeChildNode.nextElementSibling
(en-US) Somente leitura-
Returns the
Element
immediately following the specified one in its parent's children list, ornull
if the specified element is the last one in the list. NonDocumentTypeChildNode.previousElementSibling
(en-US) Somente leitura-
Returns the
Element
immediately prior to the specified one in its parent's children list, ornull
if the specified element is the first one in the list.
Methods
Inherits methods from its parent, Node
, and implements the ChildNode
and NonDocumentTypeChildNode
(en-US) interface.
CharacterData.appendData()
(en-US)-
Appends the given
DOMString
to theCharacterData.data
string; when this method returns,data
contains the concatenatedDOMString
. CharacterData.deleteData()
(en-US)-
Removes the specified amount of characters, starting at the specified offset, from the
CharacterData.data
string; when this method returns,data
contains the shortenedDOMString
. CharacterData.insertData()
(en-US)-
Inserts the specified characters, at the specified offset, in the
CharacterData.data
string; when this method returns,data
contains the modifiedDOMString
. ChildNode.remove()
(en-US) Experimental-
Removes the object from its parent children list.
CharacterData.replaceData()
(en-US)-
Replaces the specified amount of characters, starting at the specified offset, with the specified
DOMString
; when this method returns,data
contains the modifiedDOMString
. CharacterData.substringData()
(en-US)-
Returns a
DOMString
containing the part ofCharacterData.data
of the specified length and starting at the specified offset.
Specifications
Specification | Status | Comment |
---|---|---|
DOM The definition of 'CharacterData' in that specification. |
Padrão em tempo real | Added implemention of the ChildNode and NonDocumentTypeChildNode (en-US) interface. |
Document Object Model (DOM) Level 3 Core Specification The definition of 'CharacterData' in that specification. |
Obsoleto | No change from Document Object Model (DOM) Level 2 Core Specification. |
Document Object Model (DOM) Level 2 Core Specification The definition of 'CharacterData' in that specification. |
Obsoleto | No change from Document Object Model (DOM) Level 1 Specification. |
Document Object Model (DOM) Level 1 Specification The definition of 'CharacterData' in that specification. |
Obsoleto | Initial definition. |
Compatibilidade com navegadores
BCD tables only load in the browser