diff --git a/docs/create-modify-element.mdx b/docs/create-modify-element.mdx index cdcd819..caeef89 100644 --- a/docs/create-modify-element.mdx +++ b/docs/create-modify-element.mdx @@ -19,7 +19,7 @@ This method returns the **first element that matches the CSS selector**. If no m ```js document.querySelector(selector); -// Ex- .container > .box +//
document.querySelector(".box"); // returns .box document.querySelector(".not-found"); // null ``` @@ -147,5 +147,20 @@ eleDiv.appendChild(eleH1) -### 4. appendChild() +### 4. removeChild() +`Element.removeChild(childElement)` + +This method tries to remove a child element from the parent and returns the removed node. + +If the element to be removed is not a child of the parent element, it throws a `NotFoundError` DOMException. + +```js +//
+//
+//
+ +parentEle.removeChild(childEle) +``` + +