From 23993089d8640c2024d0c22a5ec9988a83cb90d9 Mon Sep 17 00:00:00 2001 From: bendtherules Date: Wed, 4 Nov 2020 19:05:17 +0530 Subject: [PATCH] element-properties - minor fixes --- docs/element-properties.mdx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/element-properties.mdx b/docs/element-properties.mdx index 5cc636b..abce158 100644 --- a/docs/element-properties.mdx +++ b/docs/element-properties.mdx @@ -101,7 +101,7 @@ for (let i = 0; i < children.length; i++) { :::note Counting number of child elements -`Element.childElementCount : number` +`Element.childElementCount: number` It returns the **number of child elements** of the given element. This is equivalent to `ele.children.length` value. @@ -140,7 +140,7 @@ childNodes // NodeList [text, span, text] :::note Is there any child node? `Node.hasChildNodes() : boolean` -This method returns a boolean value, indicating whether the given Node **has child nodes or not**. +This method checks whether the given node **has child nodes or not** and returns a boolean value. This is equivalent to checking `node.childNodes.length > 0`. @@ -152,7 +152,6 @@ This is equivalent to checking `node.childNodes.length > 0`. `Element.firstChild: Node` - This property returns the element's **first child** node in the tree. If the node has no children, then it returns `null`. `Element.nextSibling: Node` @@ -172,7 +171,7 @@ var eleC = eleB.nextSibling //
eleC.nextSibling // null ``` -There is also a similar `previousSibling` property, which returns the previous node. Also, there are element-only variant for all these properties like `firstElementChild`, `nextElementSibling`, etc. +There is also a similar `previousSibling` property which returns the previous node. Also, there are element-only variants like `firstElementChild`, `nextElementSibling`, etc.