Threadly -- setting value of #comment to an empty string


#1


https://www.codecademy.com/courses/jquery-ext/projects/jquery-prj_threadly


So I was wondering if there is another way than my code below to set the value of #comment to an empty string?


   if(comment !== "") {
      var html = $('<li>').text(comment);
      $(html).prependTo('.comments');
      $('#comment').val("");
      
    }


#2

No, that is how to clear the form field.


#3

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