mirror of
https://github.com/bendtherules/UiQuestions.git
synced 2026-08-18 22:02:42 +00:00
element-properties - Simplify nodeType explanation
This commit is contained in:
@@ -23,8 +23,8 @@ ele.tagName // "IMG"
|
||||
|
||||
:::note Text nodes don't have `tagName`
|
||||
|
||||
Text nodes are not element, so they don't have any tagName.
|
||||
To identify the type of node, use `.nodeType` - which returns `3` (same as `Node.TEXT_NODE`) for text nodes.
|
||||
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`.
|
||||
|
||||
:::
|
||||
|
||||
<span>
|
||||
|
||||
Reference in New Issue
Block a user