prefer getElementById

This commit is contained in:
David Reed 2022-11-19 18:03:19 -05:00
parent 7f2037ae69
commit a1a0ca11ef
No known key found for this signature in database
GPG key ID: 2211691D8A1EE72F
2 changed files with 7 additions and 7 deletions

View file

@ -1,6 +1,6 @@
const error = document.querySelector("#error"); const error = document.getElementById("error");
const errorCode = document.querySelector("#error-code"); const errorCode = document.getElementById("error-code");
const registerButton = document.querySelector("#register-sw"); const registerButton = document.getElementById("register-sw");
if (location.pathname.startsWith(__uv$config.prefix)) { if (location.pathname.startsWith(__uv$config.prefix)) {
error.textContent = "Error: The service worker is not registered."; error.textContent = "Error: The service worker is not registered.";

View file

@ -1,7 +1,7 @@
const form = document.querySelector("#uv-form"); const form = document.getElementById("uv-form");
const input = document.querySelector("#uv-address"); const input = document.getElementById("uv-address");
const error = document.querySelector("#error"); const error = document.getElementById("error");
const errorCode = document.querySelector("#error-code"); const errorCode = document.getElementById("error-code");
function isUrl(val = "") { function isUrl(val = "") {
if ( if (