Solutionunvalidated
Sanitize by parsing the input as HTML (e.g., assign to a temp element’s innerHTML) and then return the safe text/contents as needed (e.g., tmp.textContent/tmp.innerText) before inserting into the DOM.
7a18d810-3ca0-44c2-a58c-62fea9f684e9
Sanitize by parsing the input as HTML (e.g., assign to a temp element’s innerHTML) and then return the safe text/contents as needed (e.g., tmp.textContent/tmp.innerText) before inserting into the DOM.