Closed DogFoxX closed 3 years ago
Nevermind, got it woring with arrays. Don't know why I didn't think of it.
store.set('users', ["User 1", "User 2"]);
var usersArray = store.get('users');
var usersList;
for (i = 0; i < usersArray.length; i++) {
usersList = document.createElement('button');
usersList.id = 'user-btn';
usersList.innerHTML = usersArray[i];
document.getElementById('users').appendChild(usersList);
}
Would it be possible to save multiple string under one object name and return every string into tag? In my case I would like to store usernames and return them in a dropdown menu for selection.