-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate1.html
More file actions
51 lines (47 loc) · 1.04 KB
/
create1.html
File metadata and controls
51 lines (47 loc) · 1.04 KB
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
<!--counting characters-->
<!DOCTYPE html>
<html>
<head>
<title></title>
<style>
body{
background: skyblue;
margin-top: 50px;
}
.holder{
background: whitesmoke;
padding: 20px;
width: 450px;
}
.holder>#text{
min-height: 200px;
min-width: 400px;
max-width: 400px;
max-height: 200px;
font-size: 20px;
}
</style>
</head>
<body>
<center>
<div class="holder">
<textarea rows="8" cols="20" id="text" onkeyup="countLetter()"></textarea>
<div>No of letters:<span id="count">0</span></div>
<div>Remmaining letters:<span id="count1">20</span></div></center>
</div>
<script type="text/javascript">
function countLetter(){
var a=document.getElementById("text").value;
document.getElementById("count").innerHTML=a.length;
var b=20;
var d= a.length;
var c= b-d;
document.getElementById("count1").innerHTML=c;
if(a.length==20){
alert("you reached character limit");
document.getElementById("text").disabled="disabled";
}
}
</script>
</body>
</html>