| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ja/docs/Web/API/Node/nodeType | [Back] [Original] |
Get to know MDN better
Node.ELEMENT_NODE (1)Node.ATTRIBUTE_NODE (2)Node.TEXT_NODE (3)Node.CDATA_SECTION_NODE(4)<!CDATA[[ ]]> CDATASection
Node.PROCESSING_INSTRUCTION_NODE (7)<?xml-stylesheet ?> XML ProcessingInstruction
Node.COMMENT_NODE (8)<!-- --> Comment
Node.DOCUMENT_NODE (9)Node.DOCUMENT_TYPE_NODE (10)<!DOCTYPE html> DocumentType
Node.DOCUMENT_FRAGMENT_NODE (11)Node.ENTITY_REFERENCE_NODE (5), Node.ENTITY_NODE (6), Node.NOTATION_NODE (12)
document.nodeType === Node.DOCUMENT_NODE; // true
document.doctype.nodeType === Node.DOCUMENT_TYPE_NODE; // true
document.createDocumentFragment().nodeType === Node.DOCUMENT_FRAGMENT_NODE; // true
const p = document.createElement("p");
p.textContent = "";
p.nodeType === Node.ELEMENT_NODE; // true
p.firstChild.nodeType === Node.TEXT_NODE; // true
const node = document.documentElement.firstChild;
if (node.nodeType !== Node.COMMENT_NODE) {
console.warn("");
}
| DOM # ref-for-dom-node-nodetype |
NodeAbortControllerAbortSignalAbstractRangeAttrCDATASectionCharacterDataCommentCustomEventDOMErrorDOMExceptionDOMImplementationDOMParserDOMTokenListDocumentDocumentFragmentDocumentTypeElementEventEventTargetHTMLCollectionMutationObserverMutationRecordNamedNodeMapNodeIteratorNodeListProcessingInstructionQuotaExceededErrorRangeShadowRootStaticRangeTextTreeWalkerXMLDocumentXPathEvaluatorXPathExpressionXPathResultXSLTProcessor| Web Proxy Viewer | New URL | Original Page |