title: jQuery: Get HTML as well as input values
body: <p>I'm trying to have a variable store the HTML in a div tag, but simply using <code>var a = $('div').html()</code> doesn't store the values of the input tags that lie within the div. </p>
  
  <p>So, my question is, how should I go about saving the HTML <em>and</em> the selected options and values of input tags to a variable using jQuery?</p>
  
  <p>Here is some example code:</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;div&gt;
    &lt;p&gt;Some Text&lt;/p&gt;
    &lt;select name="word"&gt;
      &lt;option value="1"&gt;Placeholder 1&lt;/option&gt;
      &lt;option value="2"&gt;Placeholder 2&lt;/option&gt;
    &lt;/select&gt;
    &lt;input type="text" /&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Javascript:</p>
  
  <pre><code>/* "a" should also have the user values, such that when I use $('body').append(a), 
  it has the same user input as the div. */
  
  var a = $('div').html(); 
  </code></pre>
  
  <p>Thanks in advance.</p>