From a91bcc0503cb10f3b978f197c6a0c3918d2e5064 Mon Sep 17 00:00:00 2001 From: SinTan1729 Date: Tue, 11 Apr 2023 19:45:00 -0500 Subject: [PATCH] Use more direct calls instead of setAttribute --- actix/resources/static/script.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/actix/resources/static/script.js b/actix/resources/static/script.js index 46490e8..d18aef7 100644 --- a/actix/resources/static/script.js +++ b/actix/resources/static/script.js @@ -53,8 +53,8 @@ const showAlert = async (text, col) => { document.getElementById("alert-box")?.remove(); const controls = document.querySelector(".pure-controls"); const alertBox = document.createElement("p"); - alertBox.setAttribute("id", "alert-box"); - alertBox.setAttribute("style", `color:${col}`); + alertBox.id = "alert-box"; + alertBox.style.color = col; alertBox.innerHTML = text; controls.appendChild(alertBox); }; @@ -176,7 +176,7 @@ const submitLogin = () => { } else { const wrongPassBox = document.getElementById("wrong-pass"); wrongPassBox.innerHTML = "Wrong password!"; - wrongPassBox.setAttribute("style", "color:red"); + wrongPassBox.style.color = "red"; password.focus(); } })