title: Display response to a GET & POST request in a textbox
body: <p>I'm trying to get the response of a GET request inside a textfield on my webpage using jquery. Currently, I have the following code with which I can get the response on the console.</p>
  
  <pre><code>$(document).on('click', '#get-button', function(e) {
      e.preventDefault();
      $.ajax({
          type: "GET",
          url: $("#url").val(),
          data: '',
          success: function(response, textStatus, XMLHttpRequest) {
  
              console.log(response);
          }
      });
      return false;
  });
  
  $(document).on('click', '#post-button', function(e) {
      e.preventDefault();
      $.ajax({
          type: "POST",
          url: $("#url").val(),
          data: $("#json-data").serialize(),
          success: function(response, textStatus, XMLHttpRequest) {
  
              console.log(response);
          }
      });
      return false;
  });
  </code></pre>
  
  <p>Below is a part of the HTML code where I want to fit the response(in JSON) format.</p>
  
  <pre><code>&lt;div class="container"&gt;
  &lt;div class="row"&gt;
    &lt;div class="col-md-12"&gt;
      &lt;div class="panel panel-danger"&gt;
        &lt;div class="panel-heading"&gt;JSON Response&lt;/div&gt;
        &lt;div class="panel-body text-danger"&gt;
          &lt;textarea class="form-control" rows="8" placeholder="server response"&gt;&lt;/textarea&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p></p>