title: Javascript: Use var value as onclick window.open URL
body: <p>How to use a var value and pass it to the <code>window.open</code> url? I'm really no good at this, so the simpler the better. Thank you very much!</p>
  
  <pre><code>&lt;script&gt;
      if (condition) {
          var URL = "http://www.url.com";
      } else {
          var URL = "http://www.url2.com"
      }
  &lt;/script&gt;
  &lt;div id="Banner" data-responsive="225h" onclick="window.open('URL','new_window');"&gt;
  </code></pre>