title: How to execute an anchor\href in my javascript?
body: <p>I'm trying to figure this one out but my mind has just gone blank.<p></p>
  
  <ul>
  <li>I have a button element on my webpage with an id: e.g <code>&lt;button id="someId"&gt;&lt;/button&gt;</code></li>
  <li>In the document.ready function, I have an on click event which occurs when the user clicks the button. e.g. <code>$('#someId').on('click', function() {</code></li>
  <li>In this event there is an if statement which determines a value. Depending on the value, I want to execute a href in an anchor but I can't figure out the syntax.</li>
  </ul>
  
  <p>The reason I am trying to execute the anchor in the javascript is because i'm passing a variable into the href. It could be true or false.<p></p>
  
  <p>Here is what I have\what I'm trying to do. Any help would be great.<p></p>
  
  <pre><code>if (date1 &lt;= date2) {
     //I want to execute this anchor
     &lt;a href="@{Application.openthispage(true)}"&gt;&lt;/a&gt;
  }else{
     //otherwise execute this anchor
     &lt;a href="@{Application.openthispage(false)}"&gt;&lt;/a&gt;
  }
  </code></pre>