File tree 3 files changed +70
-0
lines changed
3 files changed +70
-0
lines changed Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html lang ="en ">
3
+ < head >
4
+ < meta charset ="UTF-8 ">
5
+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
6
+ < link rel ="stylesheet " href ="style.css ">
7
+ < title > Document</ title >
8
+
9
+ </ head >
10
+ < body >
11
+ < label id ="counter "> 0</ label >
12
+ < br > < br >
13
+ < div id ="btncontainer ">
14
+ < button id ="decrease " class ="btn "> Decrese</ button >
15
+ < button id ="reset " class ="btn "> Reset</ button >
16
+ < button id ="increase " class ="btn "> Increase</ button >
17
+
18
+ </ div >
19
+
20
+ < script src ="index.js "> </ script >
21
+ </ body >
22
+ </ html >
Original file line number Diff line number Diff line change
1
+
2
+
3
+ const decrease = document . getElementById ( "decrease" ) ;
4
+ const reset = document . getElementById ( "reset" ) ;
5
+ const increase = document . getElementById ( "increase" ) ;
6
+ const counter = document . getElementById ( "counter" ) ;
7
+
8
+ let count = 0 ;
9
+
10
+ decrease . onclick = function ( ) {
11
+ count -- ;
12
+ counter . textContent = count ;
13
+ }
14
+ reset . onclick = function ( ) {
15
+ count = 0 ;
16
+ counter . textContent = count ;
17
+ }
18
+ increase . onclick = function ( ) {
19
+ count ++ ;
20
+ counter . textContent = count ;
21
+ }
Original file line number Diff line number Diff line change
1
+ # counter {
2
+ font-size : 10rem ;
3
+ font-family : 'Times New Roman' , Times, serif;
4
+ text-align : center;
5
+ display : block;
6
+ }
7
+
8
+ # btncontainer {
9
+ display : flex;
10
+ text-align : center;
11
+ justify-content : center;
12
+
13
+ }
14
+ .btn {
15
+ padding : 10px ;
16
+ margin : 20px ;
17
+ font-size : 4vh ;
18
+ color : cornflowerblue;
19
+ background-color : black;
20
+ cursor : pointer;
21
+ border-radius : 10% ;
22
+ border : 10px bold blueviolet;
23
+
24
+ }
25
+ .btn : hover {
26
+ background-color : aquamarine;
27
+ }
You can’t perform that action at this time.
0 commit comments