Ex 8 Disable button 2 help!


Hi, can't seem to get it to work and not sure where I have gone wrong.Can anyone shed any light on my mistakes?. Keep getting the error message "Oops, try again. Remember to disable the Post button after posting a new message."

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

  • ').text(post).prependTo('.posts');

    var postLength = $(this).val().length;
    var charactersLeft = 140 - postLength;

    if(charactersLeft= 0) {
    else if(charactersLeft === 140) {
    else {





  • #2

    Hello @summerscalestj,

    Can you add a link to the exercise that you are having trouble with, and I will try my best to correct your errors :wink: !


    sorry, here it is


    Hey @summerscalestj,

    If you notice closely, inside of your $(".btn").click(function()), you have forgotten to close the quote for $(".btn").addClass("disabled");. Fix this and you will be good to go.


    Thank you! Couldn't see the wood for the trees!


    No worries @summerscalestj, if you feel my answer was satisfactory, please put it down as the solution so that others know this post is closed. Keep coding hard :laughing:!


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