XML DOM CharacterData ਆਬਜੈਕਟ

ਚਾਰੈਕਟਰਡੇਟਾ ਇੰਟਰਫੇਸ ਨੇ ਟੈਕਸਟ ਅਤੇ ਕਮੈਂਟ ਨੋਡ ਦੀਆਂ ਸਾਮਾਨਿਆਤਾਂ ਦੀਆਂ ਸੇਵਾਵਾਂ ਪ੍ਰਦਾਨ ਕਰਦਾ ਹੈ。

ਚਾਰੈਕਟਰਡੇਟਾ ਆਬਜੈਕਟ ਵਿਸ਼ੇਸ਼ਤਾ

ਚਾਰੈਕਟਰਡੇਟਾ ਹੈ ਟੈਕਸਟ ਅਤੇ ਕਮੈਂਟ ਨੋਡ ਦੇ ਸੂਪਰ ਇੰਟਰਫੇਸ ਹੈ।ਦਸਤਾਵੇਜ਼ ਵਿੱਚ ਕਿਸੇ ਚਾਰੈਕਟਰਡੇਟਾ ਨੋਡ ਨਹੀਂ ਹੁੰਦੇ ਹਨ ਉਹ ਸਿਰਫ ਟੈਕਸਟ ਅਤੇ ਕਮੈਂਟ ਨੋਡ ਹੁੰਦੇ ਹਨ।ਪਰ ਇਹ ਦੋਵੇਂ ਨੋਡ ਸਮਾਨ ਕੰਮ ਕਰਦੇ ਹਨ ਇਸ ਲਈ ਇਹ ਫੰਕਸ਼ਨਾਂ ਇੱਥੇ ਪਰਿਭਾਸ਼ਿਤ ਕੀਤੇ ਗਏ ਹਨ ਤਾਕਿ ਟੈਕਸਟ ਅਤੇ ਕਮੈਂਟ ਇਸ ਨੂੰ ਵਾਰਸਾ ਕਰ ਸਕਣ।

Note that it is not necessary to use the string operation methods defined by this interface. The data property is a regular JavaScript string, and you can use the + operator to perform string concatenation and can use various methods of the String and RegExp objects.

CharacterData Object Property

Property Description IE F O W3C
data The text contained in the node. 6 1 9 Yes
length The number of characters contained in the node. 6 1 9 Yes

CharacterData Object Method

Method Description IE F O W3C
appendData() Adds the specified string to the text contained in the node. 6 1 9 Yes
deleteData() Deletes the specified text from the node. 6 1 9 Yes
insertData() Inserts the specified string at the specified position in the node text. 6 1 9 Yes
replaceData() Replaces the specified number of text starting from the specified position with the specified string. 6 1 9 Yes
substringData() Returns a copy of the specified number of characters of text starting from the specified position. 6 1 9 Yes

Related Pages

XML DOM Reference Manual:Comment Object

XML DOM Reference Manual:Text Object