Thursday, October 24, 2013

Jquery to Get Length(count of characters) in a String

Leave a Comment
Jquery 'length' property can be used to get the number of characters in a string. In this example the jquery script would display number of characters entered inside textbox control on the click of a button.

Jquery to Fetch the Length of a string:

<html xmlns="">
<head runat="server">
<script src="//"></script>
<script type="text/javascript">
$(document).ready(function () {
$(function () {
         $('#btngettext').click(function (e)
                { var GetValue = $('#txtname').val();

<form id="form1" runat="server">
<asp:TextBox runat="server" ID="txtname"></asp:TextBox>
<asp:Button runat="server" ID="btngettext" Text="Display" />


Post a Comment