Why when I pus the Submit button is undefined all of them?
I want to create an array just by using input fields like this.
Is there a nother way to do this?
I tried to do it with Class name and the result is still undefined
function clicked() {
var input_value = document.querySelectorAll('#data, #data1, #data2, #data3, #data4').value;
console.log(input_value)
}
document.getElementById('btn').addEventListener('click', clicked);
<input id="data">
<input id="data1">
<input id="data2">
<input id="data3">
<input id="data4">
<button id="btn">Click me</button>