Count Characters Left


#1

Hi everyone, I know there are a few people who have had this problem. I've read all the responses and have checked and rechecked. I don't seem to be able to find out where I'm going wrong. I have also tried changing browsers and I still keep getting Oops, try again. Remember to update the '.counter' to show how many characters are left error message. PLEASE HELP!!!!

var main = function() {
    $(".btn").click(function() {
        var post = $('.status-box').val();
        $('<li>').text(post).prependTo('.posts');
        $('.status-box').val('');
});

$('.status-box').keyup(function() {
   var postLenght = $(this).val().lenght;
   var charactersLeft = 140 - postLenght;
   $('.counter').text(charactersLeft);  
});
}


$(document).ready(main);

#2

Hi Monkey,

Take a careful look at your spelling of length :wink:


#3

Thanks zystvan, I suffer with a mild form of dyslexia where I muddle up letters sometimes. I can sit a stare at a screen for ages a not see what the problem is, my brain doesn't recognise my mistakes. Thanks so much for your help, it's really appreciated!!!


#5

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