Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript clear child elements

parent.querySelectorAll("*").forEach(child -> child.remove());

//Change the value of * if there is a specific class you want to remove 
//otherwise leave the * for removing all child elements.
Comment

PREVIOUS NEXT
Code Example
Javascript :: Getting Error 404 while running npm install create-react-app 
Javascript :: beautify console log result 
Javascript :: javascript Convert to Boolean Explicitly 
Javascript :: javascript how to extract a value outside function 
Javascript :: how to get a random statement from an array in javascript 
Javascript :: create node server 
Javascript :: how to check if text input has spaces javascript 
Javascript :: tochararray in javascript 
Javascript :: datepicker select date programmatically bootstrap 
Javascript :: js indexof second occurrence 
Javascript :: create react expo 
Javascript :: how to remove first character from string in javascript 
Javascript :: largest and smallest number in an array 1-100 javascript 
Javascript :: siwtch case javascript 
Javascript :: filter object by key name 
Javascript :: stopping setinterval 
Javascript :: Use parseInt() in the convertToInteger function so it converts a binary number to an integer and returns it. 
Javascript :: sweetalert allow html 
Javascript :: javascript hello 
Javascript :: jquery select dropdown 
Javascript :: js sort object properties alphabetically 
Javascript :: nodejs spawn set env variable 
Javascript :: react native font based on viewport dimensions 
Javascript :: queryselector javascript 
Javascript :: document cookies javascript 
Javascript :: tsconfig build only files and not src 
Javascript :: vuejs router params 
Javascript :: react-dom and babel cdn 
Javascript :: use these instead of a for loop javascript 
Javascript :: disable button in angular 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =