5. Count characters left - " Make sure you have defined all the variables"


#1
var main = function(){
    $('.btn').click(function(){   
        var post = $('.status-box').val();      
        $('<li>').text(post).prependTo('.posts')    
        $('.status-box').val('');
    });
    $('.status-box').keyup(function(){
        var postLenth = $(this).val().length;
        var charactersLeft = 140 - postLength;
        $('.counter').text(charactersLeft);
    });
};

$(document).ready(main);

The error message: Oops, try again. Make sure you have defined all the variables!

What is wrong? plz help! I have tried firefox & chrome.


#2

wrong spelling. postLength instead of postLenth.