JavaScript] Intuitive complete DOM element replacement with the replaceWith method When switching between 'display mode' and 'edit mode' in a web application, or replacing a loading spinner with ...
The complete source code, a demo of adding detail rows to an expense reimbursement system, and a detailed explanation of when to use it versus createElement are available in the following blog post.