Here’s the process in brief:
Enter number: <input type=”text” name=”number”>
<input type=”button” onClick=”GuessNumber()” value=”Submit”>
..which shows on the web page as:
var mybutton = document.querySelector(“input”).value
..and one can proceed from there. Why this concept was nowhere explained in clear and concise language in the sites I visited is a mystery to me. I’m finding a lot of the coding documentation on the web is not well-written or clearly explained. It appears that a number of contributors may be proficient at writing code, but less proficient in writing explanatory prose. This can become a problem when researching information.
var guess = prompt(“Input number between 1 and 100”);
where guess captures the data entered into a pop-up box on the web page which is labeled “Input number between 1 and 100.” However, most users prefer to avoid a pop-up box, and there are other disadvantages as well. It will get the job done, but may not be the most efficient way to gather information on a web page.