Well done!
You have completed Exploring the Document Object Model (DOM): Concept and Functionality Quiz!
Quiz Question 1 of 5
In a complex web application, which of the following is the most practical approach to dynamically rearrange DOM nodes while ensuring minimal reflow and repaint, thereby optimizing performance?
Choose the correct answer below:
-
A
Use
removeChild
to detach nodes from the DOM, thenappendChild
to reinsert them at the desired location. -
B
Use
setTimeout
to delay each node rearrangement, reducing the load on the browserβs rendering engine. -
C
Use
innerHTML
to reconstruct the entire DOM structure and update it in one operation. -
D
Use
DocumentFragment
to build the new structure off-DOM and replace the entire section in a single operation.