From 3104174b42791be110a432f09378acb4bbeea5f0 Mon Sep 17 00:00:00 2001 From: kaBeech Date: Sun, 19 Mar 2023 16:10:45 -0700 Subject: [PATCH] Set textContent instead of using setHTML This way it works on Safari and Firefox without additional work, and it may be better for security --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 143ccfb..0de9132 100644 --- a/index.js +++ b/index.js @@ -103,10 +103,10 @@ seriousLightItalicButton.addEventListener("click", function () { newExampleTextInput.addEventListener("keydown", (event) => { if (event.code === "Enter") { - exampleText.setHTML(newExampleTextInput.value); + exampleText.textContent = newExampleTextInput.value; } }); newExampleTextButton.addEventListener("click", () => { - exampleText.setHTML(newExampleTextInput.value); + exampleText.textContent = newExampleTextInput.value; });