<form method="" action=""> <input autofocus type="text" name="mission" id="mission" class="" placeholder="" required > <label id="" for="mission"> name: </label> <button id="submit" type="submit">submit</button> </form>
var button = document.querySelector("#submit"); button.addEventListener("click", function(){ var firstAns = document.getElementById("#mission").value; console.log(firstAns); //there's an error });
mission
#mission
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)