title: How to add an object as value for an element using jquery?
body: <p>I have a javascript object which is constructed out of user inputs. The object looks like this:</p>
  
  <pre><code>        myObject = {
            abc: val1,
            def: val2
          }
  </code></pre>
  
  <p>I want to insert this object as the value of a html element. Tried something similar to the following to achieve this:</p>
  
  <pre><code>        $("#myelementid").val(myObject);
  </code></pre>
  
  <p>When inspecting the value of #myelementid - the value shows up as [object Object].
  However, I want the actual map to be shown. How can I achieve this?</p>