diff --git a/docs/create-modify-element.mdx b/docs/create-modify-element.mdx index 4f2ec51..819394e 100644 --- a/docs/create-modify-element.mdx +++ b/docs/create-modify-element.mdx @@ -62,7 +62,7 @@ for (var p of paras) { ## Create / insert element -### 1. createElement() +### 3. createElement() It creates a new HTML element, taking the tag name (`"div"`) as argument. @@ -88,7 +88,7 @@ document.createElement("div") -### 2. setAttribute() +### 4. setAttribute() It sets a attribute on the current element. @@ -106,7 +106,7 @@ ele.setAttribute("type", "text") -### 3. appendChild() +### 5. appendChild() It inserts a new element as the last child of the parent element. @@ -146,7 +146,7 @@ eleDiv.appendChild(eleH1) -### 4. removeChild() +### 6. removeChild() `Element.removeChild(childElement)` @@ -164,7 +164,7 @@ parentEle.removeChild(childEle) -### 5. insertBefore() +### 7. insertBefore() `Element.insertBefore(newEle, refEle)` @@ -200,7 +200,7 @@ parent.insertBefore(newEle, ref.nextSibling) -### 6. Document Fragment +### 8. Document Fragment DocumentFragment can be considered to be a off-screen lightweight `document` object. It is generally used for batching multiple operations - by doing them in the fragment over time and then rendering the whole content to the visible DOM in one shot .