JQuery swap IDs and names of html elements
<p>I can easily toggle two elements using JQuery's built in function but is there any way to swap the names and IDs of two elements. i.e. </p>

<pre><code>&lt;a onclick="jQuery('#MetaKey1, #MetaKey, #enternew, #cancelnew').toggle();return false;" href="#postcustomstuff"&gt;&lt;span id="enternew"&gt;Enter new&lt;/span&gt;&lt;span id="cancelnew" style="display:none;"&gt;Cancel&lt;/span&gt;&lt;/a&gt;
</code></pre>

<p>Where MetaKey1 is a text box and MetaKey is a list box. I wan their IDs swapped so that when the form is posted back I can get the MetaKey element value. </p>
