title: JQuery function for showing remaining characters in textarea/input
body: <p>I'm working on a piece of JQuery to show the number of remaining characters when typing into a textarea/input field. But it doesn't seem to be working, I'm very new to JQuery so I'm sure its something simple below is a copy of the code:</p>
  
  <pre><code>$(":textarea[data-limit-input]").keyup(function () {
  var charLength = $(this).val().length;
  var charLimit = $(this).attr("data-val-length-max");
  // Displays count
  $(this).next("span").html(charLength + " of " + charLimit + " characters used");
  // Alert when max is reached
  if ($(this).val().length &gt; charLimit)
      $(this).next("span").html("&lt;strong&gt;You may only have up to " + charLimit + " characters.   &lt;/strong&gt;");
  });
  </code></pre>
  
  <p>Any help would be appreciated</p>