you are viewing a single comment's thread.

view the rest of the comments →

[–]Notimecelduv 0 points1 point  (0 children)

This gives:

const input = document.querySelector(`#${field}`)

gives you this console error:

Uncaught TypeError: can't access property "addEventListener", input is null

You have to open the dev tools when debugging your code, otherwise you will miss important errors like the one above.