the murmurous sea

DOM: Node.textContent 본문

#dev/개념정리

DOM: Node.textContent

lunacer 2020. 5. 5. 11:03

1. property of the Node interface.
2. sets or returns the text content of the specified node, and all its descendants.
3. set the textContent property 
   : any child nodes are removed and replaced by a single Text node containing the specified string.

[Syntax]

Return the text content of a node:

node.textContent

Set the text content of a node:

node.textContent = htmlString

 

[Return Value]

: A String, representing the text of the node and all its descendants.
: or Returns null if the element is a document, a document type, or a notation.

 


https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent

https://www.w3schools.com/jsref/prop_node_textcontent.asp

'#dev > 개념정리' 카테고리의 다른 글

DOM: Element.innerHTML  (0) 2020.05.05
DOM: HTMLElement.innerText  (0) 2020.05.05
DOM: Node.nodeValue  (0) 2020.05.05
DOM: nodeValue vs. textConent vs. innerText vs. innerHTML  (0) 2020.05.04
JS ES1: slice()  (0) 2020.05.04
Comments