Skip to content

Commit 224c8cd

Browse files
authored
Add files via upload
1 parent 437bbed commit 224c8cd

3 files changed

Lines changed: 51 additions & 0 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
<title>Live Character Counter</title>
7+
<link rel="stylesheet" href="style.css">
8+
</head>
9+
<body>
10+
<div class="container">
11+
<input type="text" id="inputBox" placeholder="Enter your text...">
12+
<p id="counter">Characters: 0</p>
13+
</div>
14+
15+
<script src="script.js"></script>
16+
</body>
17+
</html>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const input = document.getElementById("inputBox");
2+
const counter = document.getElementById("counter");
3+
4+
input.addEventListener("input", () => {
5+
const length = input.value.length;
6+
counter.textContent = `Characters: ${length}`;
7+
});
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
body {
2+
padding: 200px;
3+
text-align: center;
4+
background: linear-gradient(to right, #485678, #098765);
5+
}
6+
7+
.container {
8+
background-color: white;
9+
padding: 50px 80px;
10+
border: none;
11+
border-radius: 50px;
12+
width: 20%;
13+
margin: auto;
14+
}
15+
16+
input {
17+
width: 90%;
18+
padding: 10px;
19+
font-size: 15px;
20+
border: 3px solid grey;
21+
border-radius: 8px;
22+
}
23+
24+
p {
25+
margin-top: 20px;
26+
margin-bottom: -20px;
27+
}

0 commit comments

Comments
 (0)