Count Characters Left


Hi I have been using this website to learn for few months now and i have a problem

I need help in clearing the error how to update the counter

var main = function()
 var post = $('.status-box').val();
    var postLength = $(this).val().length;
    var charactersLeft = 140 - postLength;

The error has been put and i cannot figure out the problem

Oops, try again. Remember to update the '.counter' to show how many characters are left.


Hi Ashwin,

That selects the HTML <status-box> element, which doesn't exist. You need to change it to $('.status-box') (with a dot (.)), so it selects the element(s) with the class="status-box" attribute instead :slightly_smiling:


Thanks for the help. I am greatful


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