Hello, I am trying to loop over some inputs, and style them depending if condition is true/false.
Here is a link to my codepen.
Not too sure why the “Uncaught TypeError: inputs.map is not a function” occurs.
My understanding is that by using inputs = document.querySelectorAll("form input)"
, I will select all the inputs from my form and return an array.
With this one, I would like to iterate on each inputs with inputs.map((input, i) => {
, and therefor style each of them.
When checking, it appears my inputs
return a NodeList
. Could the problem come from here?
I’ve tried to turn this NodeList
into an Array
object, but it didn’t work.