-
Notifications
You must be signed in to change notification settings - Fork 0
/
scores.js
40 lines (33 loc) · 1.02 KB
/
scores.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
// this page will only work if window onload is here
window.onload = function () {
// setting values and textcontent to objects
user = {
funds: document.getElementById("funds").textContent,
bet: document.getElementById("amount").value,
betRat: document.getElementById("betRat").value,
}
// adding event listeners to object
document.getElementById("amount").addEventListener('change', change);
document.getElementById("betRat").addEventListener('change', changeBetRat);
}
// identifying what user will control
var user = {
funds: null,
bet: null,
betRat: null
}
// adding function to objects
function change (event) {
user.bet = amount.value;
}
function changeBetRat (event) {
user.betRat = event.target.value;
}
// function saveMoney (event) {
// user.funds = amount.funds;
// localStorage.setItem('user','funds')
// }
// console.log (localStorage)
// function getsaveMoney (event){
// localStorage.getItem('user','funds');
// }