How to write an IF else statement without 'else'
<p>I can't use <code>else</code> in my script; how can I implement an <code>if else</code> statement without using <code>else</code>?</p>

<p>I'm trying to resize a div:</p>

<pre><code>function hideTable(){
    var table = document.getElementById('PDemo');
    if(table.style.width == "50%") table.style.width = "150px";
    if(table.style.width == "150px") table.style.width = "50%";
}
</code></pre>

<p>This script doesn't work because as soon as the first <code>if</code> statement is executed, the condition for the second <code>if</code> statement becomes true, so that executes too, thus nothing changes.</p>

<p>P.S. This isn't a homework. The software I am using only allows 1-line statements.</p>
