mirror of
https://github.com/bendtherules/UiQuestions.git
synced 2026-08-18 13:52:50 +00:00
element-properties - Add MDN badge for first 3 parts
This commit is contained in:
@@ -25,10 +25,14 @@ ele.tagName // "IMG"
|
|||||||
|
|
||||||
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` - which returns `3` (same as `Node.TEXT_NODE`) for text nodes.
|
To identify the type of node, use `.nodeType` - which returns `3` (same as `Node.TEXT_NODE`) for text nodes.
|
||||||
|
|
||||||
<MDN title="nodeType" url="https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType" />
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
<span>
|
||||||
|
<MDN title="tagName" i url="https://developer.mozilla.org/en-US/docs/Web/API/Element/tagName" />
|
||||||
|
|
||||||
|
<MDN title="nodeType" i url="https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType" />
|
||||||
|
</span>
|
||||||
|
|
||||||
|
|
||||||
## Children
|
## Children
|
||||||
|
|
||||||
@@ -95,6 +99,8 @@ for (let i = 0; i < children.length; i++) {
|
|||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
<MDN title="children" url="https://developer.mozilla.org/en-US/docs/Web/API/ParentNode/children" />
|
||||||
|
|
||||||
### 2. .childNodes
|
### 2. .childNodes
|
||||||
|
|
||||||
`Element.childNodes: NodeList`
|
`Element.childNodes: NodeList`
|
||||||
@@ -121,6 +127,7 @@ childNodes // NodeList [text, span, text]
|
|||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
<MDN title="childNodes" url="https://developer.mozilla.org/en-US/docs/Web/API/Node/childNodes" />
|
||||||
|
|
||||||
<!-- ## Content - html, text
|
<!-- ## Content - html, text
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user