I was just asked about this issue in a job interview.
Great Article but I am missing an example.
will this action result in a repaint of the entire page:
document.getElementById("demo").innerHTML = "Paragraph changed!";
?
Each time you try to update innerHTML, reflow will happen. Since updating innerHTML will cause the change of position of other elements. So that's why reflow happens.
In my view, reflow is more expensive than repaint. If you see how browser works, You will know it.
Here is the link: blog.sessionstack.com/how-javascri...
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I was just asked about this issue in a job interview.
Great Article but I am missing an example.
will this action result in a repaint of the entire page:
document.getElementById("demo").innerHTML = "Paragraph changed!";
?
And both repaint and reflow equally expensive?
Each time you try to update innerHTML, reflow will happen. Since updating innerHTML will cause the change of position of other elements. So that's why reflow happens.
In my view, reflow is more expensive than repaint. If you see how browser works, You will know it.
Here is the link: blog.sessionstack.com/how-javascri...