Please help?


#1

var main = function() {
$('.btn').click(function() {
...
});

$('.status-box').keyup(function() {
var postlength = $(this).val().length;
var characrersLeft = 140 - postLength;
$('.counter').text(charactersLeft);
});
}
$(document).ready(main);


#2

I see only two typos, here:

var postlength = $(this).val().length;
var characrersLeft = 140 - postLength;

name of the first variable should be postLength (capitalized L) and in the second one you have to change r to t -> charactersLeft:

var postLength = $(this).val().length;
var charactersLeft = 140 - postLength;

#3

you're a legend. Thanks mate!


#4

You're very welcome :slight_smile: And thank you for your kind words :panda_face:


#5

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.