<body style=”font-family:Arial, Helvetica, sans-serif; font-size:12px;”>
<div style=”width:600px;”><strong>Enter Your Status</strong>
<textarea onkeyup=”char_count()” style=”width:600px; height:400px;” id=”text_area”></textarea>
</div>
<div style=”clear:both;”></div>
<div><strong>Char Count :</strong> <span id=”count”></span></div>
<script language=”javascript”>
document.getElementById(“count”).innerHTML = 30;
function char_count()
{
var t=(document.getElementById(“text_area”).value).length;
if(t>30)
{
document.getElementById(“count”).innerHTML = “-” + (t-30);
document.getElementById(“count”).style.color=”red”;
}
else
{
document.getElementById(“count”).innerHTML = (30 – t);
document.getElementById(“count”).style.color=”black”;
}
}
</script>
</body>
Max Character Limit For Text Area
In Fun with technology on July 2, 2010 at 9:59 am
Advertisement