4/9 - Clear out the Status Box


#1

I've been through my code for at least 15 minutes now, I can't find anything that makes it not work but I keep getting the error: "Oops, try again. Remember to add code for $('.status-box').val(''); inside your $('.btn').click() function."..

This is my code:
var main = function() {
$('.btn').click(function() {
var post = $('status-box').val();
$('<li>').text(post).prependTo('.posts');
$('.status-box').val('');
});
}
$(document).ready(main)

The code that hints says:
var main = function() {
$('.btn').click(function() {
var post = $('.status-box').val();
$('<li>').text(post).prependTo('.posts');
$('.status-box').val('');
}
}

I don't know if the solution is just in front of me, but I can't seem to find it. Help please..


#2

Lol, nevermind, I found the difference, one little dot..


#3

They have missed one parenthesis to close the .click(). I received the same mistake when I wrote my code.


#4

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