title: How to set textbox value in jQuery?
body: <p>How do I properly load the a certain value into a textbox using jQuery? Tried the one below but I get the <code>[object Object]</code> as output. Please enlighten me on this, I'm new to jQuery.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>proc = function(x, y) {
    var str1 = $('#pid').value;
    var str2 = $('#qtytobuy').value;
    var str3 = $('#subtotal').load('compz.php?prodid=' + x + '&amp;qbuys=' + y);
    $('#subtotal').val(str3);
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
  
  
  &lt;form name="yoh" method="get"&gt;
    Product id: &lt;input type="text" name="pid" value=""&gt;&lt;br/&gt; 
    Quantity to buy:&lt;input type="text" name="qtytobuy" value="" onkeyup="proc(document.yoh.pid.value, this.value);"&gt;&lt;/br&gt;
  
    Subtotal:&lt;input type="text" name="subtotal" id="subtotal" value=""&gt;&lt;/br&gt;
    &lt;div id="compz"&gt;&lt;/div&gt;
  
  &lt;/form&gt;</code></pre>
  </div>
  </div>
  </p>