-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.htm
34 lines (30 loc) · 948 Bytes
/
index.htm
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
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=480">
<script type="text/javascript" src="lotto.js"></script>
<link rel="stylesheet" type="text/css" href="styles.css" />
</head>
<body>
<section id="lottoNumbers">
<ul id="lottoNumberList">
<div>feeling lucky...?</div>
</ul>
<button id="lottoBtn" type="button">click me!</button>
</section>
<script type="text/javascript">
var lottoBtn = document.getElementById('lottoBtn');
lottoBtn.addEventListener("click", function(){create_lotto_listItems()});
function create_lotto_listItems(){
var generator = new LottoNumberGenerator();
var numbers = generator.sixLottoNumbers;
var list = "";
for (var i = 0; i < numbers.length; i++) {
list += "<li>" + numbers[i] + "</li>";
}
var unorderedList = document.getElementById('lottoNumberList');
unorderedList.innerHTML = list;
};
</script>
</body>
</html>