In this article, we will learn about DOM (Document Object Model) reflow. The Document Object Model (DOM) is a programming interface for HTML (HyperText Markup Language) and XML (Extensible markup language) documents. It defines the logical structure of documents and the way a document is accessed and manipulated.
What is reflow?
The reflow of an element recomputes the dimension and position of the webpage. It also affects the HTML elementβs children, ancestors, and elements that appear after it in the DOM. Reflowing is not good for the webpage but it can be tackled very easily.
Reflow occurs by doing the below-mentioned task:
When you insert, remove, or update an element in the DOM.
When you modify content on the page, e.g. the text in an input box.