0

I'm trying to save some input values inside the local storage, the inputs are players names, I want to store them all, so I can use them later. This is what I'm trying:

const input = document.querySelectorAll("[type='text'][id^='player']");

for (i=0; i < input.length; i++) {
    localStorage.setItem('playersNames', String(input[i].value));
};
Moe G
  • 27
  • 3

0 Answers0