Threadly - is it supposed to display the comments?


I don't know if my code is correct! I think this is supposed to be a blog ...
So shouldn't the "comments field" stay populated?

var main = function() {
  $('form').submit(function() {
    var comment = $('#comments').val();
    if(comment !== "") {
      var html = $('<li>').text(comment);

    return false;




Please re-edit your Post and add the corresponding HTML code.....

  • leave one blank-line above of your code
  • select your code in the Post
  • then =click= on the </>-symbol-of-this-editor

Your code will then be in a pre-code state
and you will be able to make/present the proper indentations.

or even better use


I have just solved this.
In line 3 you choose the selector "#comments"; this should be "#comment" (the "comments" is a class and would be ".comments")
in line 6 you select the ID #html instead of the jQuery variable you created in line 5; so should read $(html) only.
hope this works for you.


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