$(function() {
    $('[data-behaviour="character-limited"]').each(function() {
        $(this).on("keyup", characterCounter);
    });

    function characterCounter() {
        var $field = $(this);
        var maxlength = parseInt($field.attr("maxlength"));
        var remainingChars = maxlength - $field.val().length;
        console.log(remainingChars);
    }

});

@@ -188,24 +188,100 @@
  = $(this);%0A
+        var $count = $field.next().children(%22.character_limited_counter%22);%0A%0A
         var 
@@ -290,16 +290,21 @@
 xlength 
+     
 = parseI
@@ -395,24 +395,25 @@
 length;%0A
+%0A
         
 console.
@@ -408,19 +408,19 @@
     
+$
 co
-nsole.log
+unt.html
 (rem

Update span element with remaining chars count