I just don’t get it. The instruction says to put “$(”.btn").addClass(“disabled”);" outside the keyup event handler, which I did, but then I get this message that it should be inside the if/else if statement. If I put it there the code doesn’t work anymore. If I put it outside (as in the code below) the code works but I can’t proceed due to the error message. Codecademy is frustrating me…in the previous steps I got an error because I had a parentheses (even though it belonged there!) and in the next step I got an error because I removed the parentheses in the previous step.
Anyways, can someone please help me with this one. What’s the problem? Thanks so much in advance!
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(charactersLeft === 140) {
(".btn").addClass(“disabled”);
} else {
$(".btn").removeClass(“disabled”);
}
});
$(".btn").addClass("disabled");
};
$(document).ready(main);
EDIT: So I just jumped ahead to “Disable the Button 2” to compare the code and unless I am blind the code is the exact same that I have above. So HOW can I make codecademy accept it and let me proceed?