1It means that document.getElementById("lastName") is returning undefined and you're trying to call classList on undefined itself.
2
3In your HTML input has the attribute name which equals lastName but there is no actual id="lastname"
4
5Either add the attribute id to your input or change getElementById to getElementsByName.
6
7Note that getElementsByName doesn't return a single item.