Wednesday, 3 April 2013

Character Count in Jquery | PHP Tutorials for Beginners

In this tutorial of php code for beginners we will show you example how to count character of text field using jquery.


<html>
  <head>
    <script src="http://code.jquery.com/jquery-1.5.js"></script>
    <script>
      function countCharacter(input) {
            var len = input.value.length;
$('#charcount').text('Character Count :- '+len);
        }
    </script>
  </head>
  <body>
    <textarea id="desc" onkeyup="countCharacter(this)"></textarea>
    <div id="charcount"></div>
  </body>
</html>

Hope this php tutorial is useful for you. Keep following www.phpcodeforbeginner.blogspot.in for more help.

No comments:

Post a Comment