Get to know MDN better
このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015年7月.
nodeValue は Node インターフェイスのプロパティで、現在のノードの値を返したり設定したりします。
もしあれば、現在のノードの値を含む文字列です。 文書自身においては、 nodeValue は null を返します。 テキスト、コメント、 CDATA ノードでは、 nodeValue はノードの内容を返します。 属性ノードにおいては、属性の値が返します。
以下の表はノードの種類別の返値を表しています。
| CDATASection | CDATA セクションの中身 |
| Comment | コメントの中身 |
| Document | null |
| DocumentFragment | null |
| DocumentType | null |
| Element | null |
| NamedNodeMap | null |
| ProcessingInstruction | 対象を除く内容物全体 |
| Text | テキストノードの中身 |
メモ: nodeValue が null になると定義されている場合は、設定しても効果がありません。
また、以下のスクリプトを参照してください。
| DOM # dom-node-nodevalue |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2025年7月22日 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.