title: Switch element types but keeping the same IDs
body: <p>I need to change the element type dynamically and below is how I am doing it:</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>$(function() {
    $('.click_me').click(function(ev) {
      var condition_value_1 = $('#condition_value_1');
      var select_html = '&lt;select name="condition_value_1" id="condition_value_1"&gt;&lt;/select&gt;';
      condition_value_1.after().html(select_html);
      condition_value_1.remove();
    });
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"&gt;&lt;/script&gt;
  &lt;input type="text" id="condition_value_1"&gt;
  &lt;span class="click_me"&gt;Click Me&lt;/span&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>After change the types as you see on the snippet above I should remove the previous element but because they share (and this is mandatory) the same ID then the new SELECT gets deleted. Is there any way to avoid this?</p>