Make Sure You Have Defined All Variables


I can't seem to find the problem with my code! Can someone help me fix it please? I keep getting a message saying I have to define variables:

var main = function() {
    $('.btn').click(function() {
        var post = $('.status-box').val();
    $('.status-box').keyup(function() {
        var postLength = $(this).val().length;
        var charactersLength = 140 - postLength;



Hi Tor,

Please post a link to the exercise you're on so we can help you.


Hi @zystvan,
Thanks for getting back to me, I should has specified, sorry! The lesson I'm in is making an interactive website: status update lesson 6: reset the counter. Let me know if you need anymore info!



Thanks for the exercise number - I should have looked closer at your code, I actually didn't need it though. But thanks anyway, it's good to include the exercise just in case :smile:

var charactersLength = 140 - postLength;

should be:

var charactersLeft = 140 - postLength;
           // ↑ `Left` instead of `Length`