I have a code where I need to send HTML with inner Html but my code is not passing the security testing it showing Cross-site Scripting (XSS) warning.
how to use innerHtml with out Cross-site Scripting (XSS) issue.
if (e.currentTarget) {
const { reamoreid } = e.target.dataset;
axios.get(`/single-readmore/${reamoreid}`).then((response) => {
readMoreContent.innerHTML = DOMPurify.sanitize(readmoreInfo(response.data));
});
I need some information about how to fix the issue.