Answer
Use document.querySelector() (or similar) to find the element, then set its textContent property to update the text safely without interpreting it as HTML.
const el = document.querySelector('#status');
el.textContent = 'Saved successfully';Real-world example Updating a status message on screen after a save action completes.