title: How to place HTML input value as a String in Jquery object value?
body: <pre><code>$("#btn_edit").click(function(){
      var token = localStorage.getItem('id_token');    
      var obj = {};
      obj.subject = $("input[name=subject]").val();
      obj.description = $("textarea[name=description]").val();
  
      $.ajax({
         type: "PUT", 
         url: "http://myurl", 
         contentType: "application/json",
         dataType: "json",
         data: JSON.stringify(obj),
         success: function(jsonresponse) {
             $(document.body).append(JSON.parse(jsonresponse));
         },
         beforeSend: function(xhr, settings) {
             xhr.setRequestHeader('Authorization', 'Bearer ' + token);
         }
      });
  });
  </code></pre>
  
  <p>but when the value is added manually it works well and even the input value is printed in the alert</p>
  
  <pre><code>alert("Text: " + $("input[name=subject]").val() + " " +  $("textarea[name=description]").val());
  
  var obj = {};
  obj.subject = "Hello";
  obj.description = "Help please";
  </code></pre>