title: How to join two jQuery element objects? .add() isn't working
body: <p>I'm inside a function and I need to return a jQuery object with two elements. Inside the function I have, for example:</p>
  
  <pre><code>function getInput() {
      $hiddenInput = $('&lt;input type="hidden"&gt;');
      //(other code)
      $select = $('&lt;select&gt;&lt;/select&gt;');
      //(other code)
      $hiddenInput.add($select);
      return $hiddenInput;
  }
  </code></pre>
  
  <p>And outside I have:  </p>
  
  <pre><code>$myContainer.append(getInput());
  </code></pre>
  
  <p>The result expected would be:</p>
  
  <pre><code>&lt;div id="container"&gt;&lt;input type="hidden"&gt;&lt;select&gt;&lt;/select&gt;&lt;/div&gt;
  </code></pre>
  
  <p>But the only thing I get right now with .add() is only the input element and not the select. How can I joint those two form elements on the function return? If not possible with jQuery, then with plain JavaScript. Thanks a lot.</p>