Retrieving Length of the Text area while user types in text area using JavaScript.

Vishalneeraj-24503
Posted by Vishalneeraj-24503 under JavaScript category on | Points: 40 | Views : 806
Write below Javascript Code:-
<script type = "text/javascript">

function Display_Length(obj)
{
document.getElementById("lbl_length").innerHTML = '(' + obj.value.length + ')';
}

</script>

//On onkeyup event,we have to call above function.
<textarea id = "summary" runat = "server" style = "width: 500px; height: 80px;"
onkeyup = "Display_Length(this);"></textarea>
<asp:Label ID = "lbl_length" runat = "server" Text = ""></asp:Label>

Comments or Responses

Login to post response