title: Set Checkbox to Checked with JavaScript after page Load
body: <p>I've got a small challenge in trying to set this checkbox element on my page to checked, after the page loads:</p>
  
  <p><code>&lt;input type="checkbox" id="1403317"&gt;</code></p>
  
  <p><strong>Challenges:</strong><br/>
  1. This <code>&lt;input&gt;</code> can only be called by its <strong>id</strong> since there's no <strong>name</strong> attribute set.<br/>
  2. The JS code to do this cannot be placed inside the <code>&lt;head&gt;&lt;/head&gt;</code> tag - I don't have access to that part of the code in this use case so this must work somewhere in <code>&lt;body&gt;&lt;/body&gt;</code>. </p>
  
  <p>Here's how I've tried to do this so far (before the closing <code>&lt;/body&gt;</code> tag), but with no effect. Is something wrong with my syntax?</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      window.onload = function() {
      document.getElementById("1403317").checked = true;
      }
  &lt;/script&gt;
  </code></pre>