title: Replace multiple elements using replace with in query
body: <p>I have a <code>textarea</code> and <code>button</code> that I need to replace with new ones. I use <code>replaceWith</code> in jquery to achieve this but it seems that I'm doing it wrongly.</p>
  
  <p>This is my javascript:</p>
  
  <pre><code>&lt;script&gt;
  $(document).ready(function () {
       $(document).on('click', 'div', function(){
       $('textarea, button').replaceWith('&lt;textarea&gt;New&lt;/textarea&gt;&lt;button&gt;Old&lt;/button&gt;');
       });
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>My HTML:</p>
  
  <pre><code>&lt;textarea&gt;Old&lt;/textarea&gt;
  &lt;button&gt;Old&lt;/button&gt;
  
  &lt;div&gt;Replace&lt;/div&gt;
  </code></pre>
  
  <p>Clicking the <code>Replace</code> div should replace both the <code>Old</code> text area and the button with the new ones but for some reason it leads to displaying 2 text areas and 2 buttons.</p>
  
  <p>Tried using <code>$('textarea', 'button')</code> but this does nothing at all.</p>