I am making a game that says a random number to click and then it tells you when it is right or wrong. I want the user to decide how many rounds they want and input it into the program.
//takes the number of rounds and puts it into a variable so it shows the amount of questions you want
var numberOfRounds = parseInt( document.getElementById( "numberOfRounds" ).value ) //puts the input numberOfRounds in a variable.
console.log(numberOfRounds);
randomNumber = ( Math.floor(Math.random() * 6));
console.log(randomNumber);
buttonColors();
<font size="6"><center><strong><p id="startScreen">Welcome to the Random Color Game.</p></strong></center></font>
<font size="4"><center><p id="startScreen2">How many many rounds of the game would you like?</p>
<form id="numberOfRounds"><p id="startScreen3">I would like <input id="numberOfRounds" type="number" min="1" max="20" name="numberOfRounds" style = "width:100px; height:50px;"> rounds.</p>
<p id="startScreen5">To start playing the game, push begin.</p></center></font>
document.getElementById( "numberOfRounds" )gives you the first element found, i.e.form. That doesn't have value though.ids must be unique within the document.