-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
23 lines (20 loc) · 802 Bytes
/
script.js
File metadata and controls
23 lines (20 loc) · 802 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Select all inputs and button
const usernameInput = document.getElementById("username");
const emailInput = document.getElementById("email");
const passwordInput = document.getElementById("password");
const inputs = document.querySelectorAll("input");
const button = document.getElementById("submitBtn");
// Add click event to button
button.addEventListener("click", () => {
button.style.border = "1px solid blue";
button.style.color = "white";
button.style.background = "darkblue";
//change border color of inputs to blue
inputs.forEach(input => {
input.style.border = "1px solid blue";
});
// Print username & password to console
console.log("Username:", usernameInput.value);
console.log("Email:", emailInput.value);
console.log("Password:", passwordInput.value);
});