From 83646d35ec235988bdd841b84bc306954d7c0006 Mon Sep 17 00:00:00 2001 From: bendtherules Date: Fri, 16 Oct 2020 02:26:58 +0530 Subject: [PATCH] create-modify-element - clarify method name --- docs/create-modify-element.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/create-modify-element.mdx b/docs/create-modify-element.mdx index 4714c1a..fa161a7 100644 --- a/docs/create-modify-element.mdx +++ b/docs/create-modify-element.mdx @@ -64,7 +64,7 @@ for (var p of paras) { ### 1. `createElement()` -The `document.createElement` method creates a new HTML element, taking the tag name (`"div"`) as first argument. +It creates a new HTML element, taking the tag name (`"div"`) as argument. To set attributes and add the element to DOM, look at `.setAttribute` and `.appendChild` below. @@ -92,7 +92,7 @@ document.createElement("div") ### 2. `setAttribute()` -Every element has a `setAttribute` method - which sets a attribute on the current element. +`Element.setAttribute` sets a attribute on the current element. `setAttribute(name, value)` @@ -110,7 +110,7 @@ ele.setAttribute("type", "text") ### 3. `appendChild()` -The `.appendChild()` method inserts a new element as the last child of the current element. +`Element.appendChild` inserts a new element as the last child of the current element. `ele1.appendChild(ele2)`