/ Published in: jQuery
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<!-- HTML --> <input type="text" id="input-text"/><span id="count"></span> //JavaScript $(document).ready(function() { $("input[id='input-text']").keyup(function count(){ counter = $("input[id='input-text']").val().length; $("#count").html(counter); }); });
URL: http://woorkup.com/2009/10/14/jquery-lessons-how-to-interact-with-html-forms/