Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 3cb8f8f

Browse files
intial setup of project
1 parent 3f1cdf6 commit 3cb8f8f

File tree

3 files changed

+28
-7
lines changed

3 files changed

+28
-7
lines changed

‎project/index.html

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
<title>creating stop watch using js</title>
99

1010
<link rel="stylesheet" href="style.css">
11-
12-
<link rel="stylesheet" href="script.js">
1311
</head>
1412

1513
<body>
@@ -19,12 +17,16 @@ <h1>stopwatch</h1>
1917
<h2>vanila javascript stopwatch</h2>
2018

2119

22-
<p>time</p>
20+
<p id="sec">time</p>
21+
<p id="milsec">time</p>
2322

24-
<button class="btn">start</button>
25-
<button class="btn">stop</button>
26-
<button class="btn">reset</button>
23+
<button class="btn"id="start">start</button>
24+
<button class="btn"id="stop">stop</button>
25+
<button class="btn"id="reset">reset</button>
2726
</div>
27+
28+
29+
<script src="script.js"></script>
2830
</body>
2931

3032
</html>

‎project/script.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
let start = document.getElementById('start');
3+
let stop = document.getElementById('stop');
4+
let reset = document.getElementById('reset');
5+
6+
let show = document.getElementById('show');
7+
8+
const d = new Date();
9+
let hours = d.getHours();
10+
11+
show.innerHTML = hours;
12+
console.log(show.innerHTML);

‎project/style.css

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ body {
1212
}
1313

1414
.btn {
15+
display: inline-block;
1516
background-color: transparent;
1617
border: 1.3px solid white;
1718
width: 8rem;
@@ -23,6 +24,12 @@ body {
2324
margin-top: 2rem;
2425
}
2526

27+
.btn:hover{
28+
background-color: cyan;
29+
transition: all 0.4s;
30+
}
31+
2632
p{
33+
display: inline-block;
2734
margin-top: 2rem;
28-
}
35+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /