Interactive Website Status Update


#1


https://www.codecademy.com/courses/web-beginner-en-hk5qh/0/3?content_from=make-an-interactive-website%3Ajquery-dom-manipulation#

Oops, try again. It looks like the Post button didn't add a new message. Remember to prepend a new li element inside the event handler.


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


#2

Hi @haileyldo,

You need to call your main function so the code inside it gets run. If you add this to the bottom of your code, it should work :slight_smile:

$(document).ready(main);

#3

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