I am making a simple quiz where user inputs their name. Upon submitting their results their name and results are displayed. I gather the user's name input with.
A link to the repo for full code https://github.com/ambibma/programlanguageselector
When user submits form a function handleSubmit(event is executed)
function handleSubmit(event){
event.preventDefault();
and variables are set
let nameInput = document.getElementById("nameinput").value;
const nameResult = document.getElementById("name");
Then branching is used to determine the result, when a result is reached, it is displayed through:
nameResult.innerText = nameInput;
htmlResult.classList.remove("hidden");
However, in my html:
<p> <span id="name">__</span> , you should learn HTML!</p>
The name is not inputted.
function handleSubmit(event){
event.preventDefault();
let nameInput = document.getElementById("nameinput").value;
const nameResult = document.getElementById("name");
Then branching is used to determine the result, when a result is reached, it is displayed through:
nameResult.innerText = nameInput;
htmlResult.classList.remove("hidden");
However, in my html:
<p> <span id="name">__</span> , you should learn HTML!</p>
The name is not inputted.