英文:
is innerHTML with radio buttons safe?
问题
I know that using innerHTML with user input is not safe, but I'm wondering if it's okay if you're using radio buttons, where the only user input is checked vs. unchecked.
我的JS代码如下:
const topsButton = document.getElementById("tops");
topsButton.addEventListener("click", () => {
chart.innerHTML = "<div>somehtml</div>";
});
确定
评论