-
Notifications
You must be signed in to change notification settings - Fork 0
/
Charecter Count.html
67 lines (67 loc) · 1.36 KB
/
Charecter Count.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
<!DOCTYPE html>
<html>
<head>
<title>Character Counter</title>
</head>
<script>
function counter()
{
var text = document.getElementById("txt").value;
var charCount = text.length;
document.getElementById("para").innerHTML = "Total Character: ";
document.getElementById("count").innerHTML = charCount;
}
</script>
<style>
button{
/* to make round edges*/
border-radius: 12px;
background-color:#9b4135;
border-color:#8a382d ;
color: rgb(255, 255, 255);
font-size: x-large;
}
#count{
font-family:"Lucida Console";
color:#9b4135;
font-size: 75px;
text-align: center;
}
table{
border: 25px double #9b4135;
background-color: white;
text-align: center;
}
textarea {
/* sets size of the textarea */
height: 75px;
width: 400px;
}
h1 {
color: rgb(255, 255, 255);
line-height: 10px;
}
body{background-color: #9b4135;}
.lbl{color:#9b4135;}
</style>
<body>
<h1 align ="center">CHARACTER COUNTER</h1>
<table cellspacing ="30px" align ="center">
<tr><td>
<h2 class="lbl">
Type or Paste the text below:
</h2>
<textarea id="txt"></textarea>
</td></tr>
<tr><td>
<button onclick="counter()">
Get the character count
</button>
</td></tr>
<tr><td>
<p id="para" class="lbl"></p>
<h1 id="count"></h1>
</td></tr>
</table>
</body>
</html>