JavaScript - Replace two characters with each other?
<p>I have a string and I want to replace every capital 'I' with small 'i', and every small 'i' with a capital 'I'. As you can see if I do this in two stages it just converts it, then converts it back to how it was before. So how would I do it all at once?</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;script type="text/javascript"&gt;
function init() {
    text = document.getElementById('test');
    newtext = text.innerHTML.replace(/I/g, "i");
    newtext = newtext.replace(/i/g, "I");
    text.innerHTML = newtext;
}
&lt;/script&gt;   
&lt;/head&gt;

&lt;body onload="init()"&gt;
&lt;div id="test"&gt;
THIS IS SOME TEST 
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
