--- title: Node.nodeValue slug: Web/API/Node/nodeValue tags: - DOM - Gecko - Gecko DOM Reference - Node translation_of: Web/API/Node/nodeValue ---
ノードの値を取得または設定します。
value = node.nodeValue
node.nodeValue が存在する場合、 value はノードの値を含む文字列です。
document 自身は、 nodeValue は nullを返します。text
ノード、 comment ノード、CDATA ノードでは、 nodeValue はノードの中身を返します。 attribute ノードは属性値を返します。
以下の表は、 様々なノードの戻り値を表しています。
| Attr | attribute の値 |
|---|---|
| CDATASection | CDATA Sectionの中身 |
| コメント | commentの中身 |
| Document | null |
| DocumentFragment | null |
| DocumentType | null |
| Element | null |
| NamedNodeMap | null |
| EntityReference | null |
| Notation | null |
| ProcessingInstruction | ターゲットを除く全体の内容 |
| Text | the text nodeの中身 |
nodeValue が null と定義されている場合、値を設定しても効果はありません。