I am trying to take a text value, input by the user, pass into a javascript variable and store it so it can be used in math functions after further input. Before that I need to get the inputs stored as variables. The input field id is Numb1, Once submit is pressed, I'd think the value input is passed into the firstNumb var in the assignVar function via the document.getElementbyID().
When I input a number, press submit and use the console in chrome to see what firstNumb is I get an uncaught reference error stating firstNumb is not defined.
Where am I going wrong with this?
Here is my form/input and script code
<form>
<input type="number" id="Numb1">
<input name="submit" type="submit" onclick="assignVar()">
</form>
<script>
function assignVar() {
var firstNumb = document.getElementByID("Numb1");
}
</script>
Thanks for any help