--- title: CharacterData slug: Web/API/CharacterData translation_of: Web/API/CharacterData ---
{{APIRef("DOM")}}
A interface abstrata CharacterData representa um objeto {{domxref("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 {{domxref("Text")}}, {{domxref("Comment")}} ou {{domxref("ProcessingInstruction")}}, que não são abstratas.
{{InheritanceDiagram}}
Herda propriedades de seu pai, {{domxref("Node")}}, e implementa as interfaces {{domxref("ChildNode")}} e {{domxref("NonDocumentTypeChildNode")}}.
unsigned long
representando o tamanho da string contida em CharacterData.data
.null
if the specified element is the last one in the list.null
if the specified element is the first one in the list.Inherits methods from its parent, {{domxref("Node")}}, and implements the {{domxref("ChildNode")}} and {{domxref("NonDocumentTypeChildNode")}} interface.
CharacterData.data
string; when this method returns, data
contains the concatenated {{domxref("DOMString")}}.CharacterData.data
string; when this method returns, data
contains the shortened {{domxref("DOMString")}}.CharacterData.data
string; when this method returns, data
contains the modified {{domxref("DOMString")}}.data
contains the modified {{domxref("DOMString")}}.CharacterData.data
of the specified length and starting at the specified offset.Specification | Status | Comment |
---|---|---|
{{SpecName('DOM WHATWG', '#characterdata', 'CharacterData')}} | {{Spec2('DOM WHATWG')}} | Added implemention of the {{domxref("ChildNode")}} and {{domxref("NonDocumentTypeChildNode")}} interface. |
{{SpecName('DOM3 Core', 'core.html#ID-FF21A306', 'CharacterData')}} | {{Spec2('DOM3 Core')}} | No change from {{SpecName('DOM2 Core')}}. |
{{SpecName('DOM2 Core', 'core.html#ID-FF21A306', 'CharacterData')}} | {{Spec2('DOM2 Core')}} | No change from {{SpecName('DOM1')}}. |
{{SpecName('DOM1', 'level-one-core.html#ID-FF21A306', 'CharacterData')}} | {{Spec2('DOM1')}} | Initial definition. |
{{Compat("api.CharacterData")}}