+ 1
The if statement will run at the beginning, but there is no input value at that time. So you need to create a function and connect it via EventListener to check for changes in the input field. https://code.sololearn.com/W6XykbZaD68X/?ref=app
26th May 2022, 11:00 PM
Nexus
Nexus - avatar
+ 1
Your Mom change the last part of your script: you used = instead of === in you if statement. function submit() { if (document.getElementById("number").style.color === "limegreen" && document.getElementById("symbol").style.color === "limegreen" && document.getElementById("lowerCase").style.color === "limegreen" && document.getElementById("upperCase").style.color === "limegreen" && document.getElementById("characters").style.color === "limegreen") { alert("Submitted Form!"); } }
28th May 2022, 1:54 PM
Bob_Li
Bob_Li - avatar
0
After submit is clicked or ?
26th May 2022, 5:12 PM
MATOVU CALEB
MATOVU CALEB - avatar
0
Your Mom put the inputs inside a flex div. Adjust the length of the input boxes by adding a size attribute=number of characters. <div style="display:flex;"> <input type="text" id="yourName" placeholder="First Name" size="15"></input> <input type="text" id="yourName" placeholder="Last Name" size="15"></input> </div>
28th May 2022, 3:11 PM
Bob_Li
Bob_Li - avatar
0
Your Mom you should assign your dom elements to const variables. That way, it would be easier to use them later in your code(getting or assigning values, changing style or adding callback functions). Wouldn't want to type and read document.getElementById(...) all the time. It's error prone and hard to read.
28th May 2022, 3:19 PM
Bob_Li
Bob_Li - avatar