I'm trying to make a form which accepts values from the user and then passes those values to a JS function in the same file for some calculations. I'm just trying to print the values to the console right now, but I keep getting the error "Object #<HTMLDocument> has no method 'getElementByID'". Here is the code:
<!DOCTYPE html>
<html>
<body>
<form action="javascript:formHandler();" method="get">
<h1 align="center">Set the parameters you would like to visualize</h1>
Center Frequency: <input type="text" name="cf" id="cf"><br>
Bandwidth: <input type="text" name="bw" id="bw"><br>
Number of Bins: <input type="text" name="bins" id="bins"><br>
Number of Values to be Visualized: <input type="text" name="values" id="values"><br>
<input type="submit" value="Submit">
</form>
<script>
function formHandler()
{
console.log(document.getElementByID("cf")); // This is where I'm getting the error
}
</script>
</body>
</html>