No idea what's wrong


#1

var main=function() {

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

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

if (charactersLeft < 0) {
$('.btn').addClass('disabled');
}

else if (characterLeft == 140) {
$('.btn').addClass('disabled');
}

else{
$('.btn').removeClass('disabled');
}

});

$('.btn').addClass('disabled');
};
$(document).ready(main);

can I get some help pleas I don't see what's wrong.


#2

You wrote characterLeft.


#3

just one s, it worked thanks!


#4

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