GENERAL INPUT INFORMATION
Inputs are built by HTML and JavaScript working tandem. HTML anchors the JavaScript and JavaScript executes the logic. User inputs are always treated as strings in JavaScript, just like in Python. FIXME: ADD INPUT METHODS
JAVASCRIPT ANCHOR POINTS IN HTML
JavaScript is often anchored in the <head> elements. If the script is not anchored with defer it will run as soon as the page is loaded by the browser.
EXAMPLE OF ANCHORING A SCRIPT IN HTML
<head> <script src="basicInput.js" defer></script> <head> <!-- The defer will make this load after the page loads, otherwise without defer it loads immediately.-->
USING prompt()
The prompt() method is the most direct way to request user input. It populates in a popup, and functions, similarly to the Python input() method.
basicInput.js
This program uses the prompt() method to get input from the user. It is anchored in the head element with defer.
<head>
<script src="basicInput.js" defer></script> <head> <!-- The defer will make this load after the page loads, otherwise without defer it loads immediately.-->
document.getElementById("prompt").addEventListener("click", runBasicInput);
/*Ignore the above line for now. This is an event listener that calls a function
when the user clicks a button.
function runBasicInput()
{
let usr_letter =prompt("Please enter a letter: ");
alert(`You entered: ${usr_letter}.`);
}