-
Notifications
You must be signed in to change notification settings - Fork 0
/
js0519-4.html
119 lines (108 loc) · 3.16 KB
/
js0519-4.html
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>js 練習</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.container {
margin-top: 30px;
font-size: medium;
}
h2 {
text-align: center;
}
table {
width: 70%;
text-align: center;
border: 1px solid lightblue;
margin: 0 auto;
}
td {
height: 70px;
}
tr,
td {
border: 1px solid lightblue;
}
th {
border: 1px solid lightpink;
}
</style>
</head>
<body>
<div class="container">
<form action="" method="get" id="myForm">
<table>
<tr>
<td colspan="4">
<h2>飲料點餐</h2>
</td>
</tr>
<tr>
<th>品名</th>
<th>單價</th>
<th>數量</th>
<th>總價</th>
</tr>
<tr>
<td>花茶</td>
<td>
<input type="number" name="item1" id="item1" value="100">
</td>
<td>
<input type="number" name="item1Num" id="item1Num">
</td>
<td>
<input type="number" name="item1Price" id="item1Price">
</td>
</tr>
<tr>
<td>咖啡</td>
<td>
<input type="number" name="item2" id="item2" value="200">
</td>
<td>
<input type="number" name="item2Num" id="item2Num">
</td>
<td>
<input type="number" name="item2Price" id="item2Price">
</td>
</tr>
<tr>
<td>黃金水</td>
<td>
<input type="number" name="item3" id="item3" value="500">
</td>
<td>
<input type="number" name="item3Num" id="item3Num">
</td>
<td>
<input type="number" name="item3Price" id="item3Price">
</td>
</tr>
<tr>
<td>
總價
</td>
<td colspan="2">
<p id=result>
0
</p>
</td>
<td>
<button type="submit" id="sumbit">多少錢</button>
</td>
</tr>
</table>
</form>
</div>
<script src="./js/main.js"></script>
</body>
</html>