When I retrieve the value of the ID "name" it always returns undefined. I used document.getElementById("name").value;
but it was still showing an undefined error.
const value = document.getElementById("name").value;
console.log(value);
<input type =text" id="name">