diff --git a/docs/element-properties.mdx b/docs/element-properties.mdx index 9f582bf..910f449 100644 --- a/docs/element-properties.mdx +++ b/docs/element-properties.mdx @@ -12,7 +12,7 @@ import MDN from "../components/MDNBadge" `Element.tagName: string` -This read-only property on any element returns the **tag name** in uppercase form. This is useful to identify type of a element. +This read-only property on any element returns the **tag name** in uppercase form. This is useful to identify type of an element. Ex. `.tagName` of `
` element is `"DIV"`. @@ -24,7 +24,7 @@ someImage.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` property. For text nodes, `nodeType` is `3` - same as the constant `Node.TEXT_NODE`. +Text nodes are not elements, so they don't have any tagName. To identify the type of node, use `.nodeType` property. For text nodes, `nodeType` is `3` - same as the constant `Node.TEXT_NODE`. ::: @@ -39,7 +39,7 @@ Text nodes are not element, so they don't have any tagName. To identify the type `Node.parentElement: Element | null` This property returns **the parent element** of the current node. If there is no parent, it returns null. -The topmost parent element in DOM is `document`. You can use this to check if a element is detached from dom. +The topmost parent element in DOM is `document`. You can use this to check if an element is detached from dom. ```js
@@ -53,7 +53,8 @@ child.parentElement //
-var eleA = document.getElementByID("A") +let eleA = document.getElementById("A") -var eleB = eleA.firstChild //
-var eleC = eleB.nextSibling //
+let eleB = eleA.firstChild //
+let eleC = eleB.nextSibling //
eleC.nextSibling // null ```