title: If statement with html id
body: <p>I have the code below that gets an <code>id</code> if there is any and asks you to click a button to show you data.</p>
  
  <pre><code>&lt;input type="text" id="date" value="&lt;?php echo $_GET['id']?&gt;" class="css-input" placeholder="Posting Date..." readonly="readonly" /&gt;&lt;br /&gt;&lt;br /&gt;    
  &lt;input type="button" id="validate" value="Let's get to work!" class="btn" /&gt; 
  </code></pre>
  
  <p>The code below takes you to the data automatically without needing to click a button if there is an id there.:</p>
  
  <pre><code>jQuery(document).ready(function() {
      jQuery("#validate").click();
  });
  </code></pre>
  
  <p>How can I do an <code>if</code> statement that if <code>#validate</code> is not null then execute the jQuery code else don't. How could I do that whenever I do <code>&lt;?php if(#date != null)</code> I get an error, any ideas?</p>