title: Empty Input After AJAX Post Submit
body: <p>I want to empty OR clear input field after the comment has been submitted through jQuery AJAX post submit. Here is jQuery code I am using;</p>
  
  <pre><code>$(".textbox2").on('keypress', function (e) {
      if (e.keyCode == 13 &amp;&amp; !e.shiftKey) {
          e.preventDefault();
  
          var message = $("#message").val(),
              privateid = $("#private");
  
          if (message == '') {
              alert("Message is missing!!");
              return;
          }
  
          if (privateid.is(':checked')) {
              var privateidVal = privateid.val();
          }
  
          $.ajax({
              type: "post",
              dataType: "json",
              url: "shout.php",
              data: "message=" +
                  encodeURIComponent(message) +
                  "&amp;private=" +
                  encodeURIComponent(privateidVal) +
                  "&amp;action=addcomment",
              success: function (data) {
                  showComment();
                  document.getElementById('message').value = '';
                  document.getElementById('message').focus();
                  document.getElementById('private').checked = '';
  
                  if (data.error) {
                      alert(data.error);
                  }
              }
          });
      }
  });
  </code></pre>
  
  <h2>INPUT FIELD:</h2>
  
  <p><code>&lt;input type="text" class="textbox2" size="90" maxlength="200" name="message" id="message" autocomplete="off" style="width: 90%;"&gt;</code></p>
  
  <p>The issue is, it cleared in Chrome but not in Safari and FirefOx browsers. What could be the reason? Please help!</p>