element-properties - Simplify nodeType explanation

This commit is contained in:
2020-10-31 10:51:42 +05:30
parent 38d6f05583
commit 32d0b7a01c
+2 -2
View File
@@ -23,8 +23,8 @@ ele.tagName // "IMG"
:::note Text nodes don't have `tagName` :::note Text nodes don't have `tagName`
Text nodes are not element, so they don't have any tagName. Text nodes are not element, so they don't have any tagName. To identify the type of node, use `.nodeType`. For text nodes, `nodeType` is `3`- same as the constant `Node.TEXT_NODE`.
To identify the type of node, use `.nodeType` - which returns `3` (same as `Node.TEXT_NODE`) for text nodes.
::: :::
<span> <span>