On 7. Disable Button 1 of the Interactive Website: Status Update, I am getting this error: "Unexpected token ILLEGAL"


#1

I am having the same problem and I do not know why. I am on number 7. Disable Button 1 of the Interactive Website: Status Update. I am getting an error message that states "Unexpected token ILLEGAL". Please help

var main=function() {

$('.btn').click(function() {
var post = $('.status-box').val();
$('

').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't figure out what's wrong on #7
#2

Hi Scott,

For a start, fix lines 5 and 7. They should be one line, instead of two, and you should have something between the single quotes ('). The instructions in one of the previous exercises tell you what to put there :slight_smile:


#3

Thanks, much appreciated! :smiley:


#4

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