4. Clear out the box: Error?


#1

Using this code:

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

  • ').text(post).prependTo('.posts');
    $('.status-box').val('');
    });

    };

    $(document).ready(main);

    I continue to get this error message, and cannot move forward:

    Oops, try again. Remember to add code for $('.status-box').val(''); inside your $('.btn').click() function.

    Am I tripping? And, even if I am, how do I get to move forward? Thanks!!


  • #2

    Hi Metalwright,

    You forgot the dollar sign ($) in front of ('.status-box') on line 4 :)


    #3

    Wow, talk about not being able to see the forest for the trees... I was so focused on Line 6, I completely missed that error up there!

    Thank you!


    #4

    Haha, that happens a lot in programming :)
    Good luck with the rest of the course!