Jquery: How to clear an element before appending new content? May 30, 2023 by Tarik .append() appends html to the end of existing html string, use .html() to replace what’s currently inside of #dialog.