-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathScript-users.js
42 lines (34 loc) · 1.03 KB
/
Script-users.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
const users= [
{
"gamertag":"BEHUJAN",
"Pronomen":"Lorem ipsum",
"alter":"12",
"LieblingsGames":"Minecraft",
},{
"gamertag":"IsabelDochMal",
"Pronomen":"Lorem ipsum",
"alter":"28",
"LieblingsGames":"Gartic Phone",
},{
"gamertag":"Tobi",
"Pronomen":"Lorem ipsum",
"alter":"16",
"LieblingsGames":"FORTNITE",
}
]
let index = 0
window.addEventListener("load",function(){
document.getElementById("gamertag").value = users[index].gamertag
document.getElementById("alter").value = users[index].alter
document.getElementById("lieblingsgame").value = users[index].LieblingsGames
})
const onButtonClicked = function () {
if(index < users.length - 1) {
index++
} else {
index=0
}
document.getElementById("gamertag").value = users[index].gamertag
document.getElementById("alter").value = users[index].alter
document.getElementById("lieblingsgame").value = users[index].LieblingsGames
}