How can I define a variable in javascript before using it?
<p>I want to do the following:</p>

<pre><code>if (htmlEdit) {
    var dialogDiv = $('#commonDialog');
} else {
    var dialogDiv = $('#commonDialog2');
} 
</code></pre>

<p>But if I do that I think dialogDiv will not be available outside of the if-else. How can I declare it so I will be able to use it in another place after the if-else?</p>
