Javascript DOM Interview Question-1
2 min readSep 11, 2019
You have given Html element structure -
Now you need to insert data to every div using Javascript!
First we need to get length of nested HTML elements
Now loop over children <div> and append <p> hey </p> element
Output:
Now HTML structure look likes —
Execute this code here —
If you like this post please give a clap and follow. Write in the comment section for any question or suggestion.