Hi all. I have a question…
How to get all inputs values and store it in the array?
getInputValue = () => {
let inputsArray = [];
let inputValue = document.querySelector(".input").value;
inputsArray.push(inputValue);
console.log(inputsArray);
};
I tried this code, but i get only the value of the first input.
I tried also querySelectorAll but than i get undefined…
Thanks!!
getInputValue = () => {
let inputsArray = [];
document.querySelectorAll(".input").forEach(item => {
inputsArray.push(item.value)
});
console.log(inputsArray);
};
1 Like
Super 
This is exactly what I was looking for.
Thanks!!!
Hi. I have multiple inputs in HTML I need to get those values and sort it from lowest to highest.
1 Like
Yup, I see that you found your solution. That’s great, sorry I didn’t help you much. Anyways, Happy Coding !!
1 Like