title: Chrome Extension - input Checkbox checked by default
body: <p>I developed a Chrome Extension, and added an On/Off toggle to control the injection of the content scripts. </p>
  
  <p>In my <strong>popup.html</strong>, the following div was added with a checkbox: </p>
  
  <pre><code>&lt;div class="onoffswitch"&gt;
  &lt;input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="myonoffswitch" checked&gt;
  &lt;label class="onoffswitch-label" for="myonoffswitch"&gt;
      &lt;span class="onoffswitch-inner"&gt;&lt;/span&gt;
      &lt;span class="onoffswitch-switch"&gt;&lt;/span&gt;
  &lt;/label&gt;
  </code></pre>
  
  <p></p>
  
  <p>The <strong>popup.js</strong> is setting the 'onoffswitch' selection in chrome storage as follows: </p>
  
  <pre><code>$(document).ready(function() {
  $('#myonoffswitch').on('change', function(e) {
  
      chrome.storage.sync.set({
          'myonoffswitch': ($(this).is(":checked"))
      }, function() {});
  })
  chrome.storage.sync.get('myonoffswitch', function(storage) {
      $('#myonoffswitch').prop('checked', (storage.myonoffswitch == true));
  })
  
  $('#myonoffswitch2').on('change', function(e) {
  
      chrome.storage.sync.set({
          'myonoffswitch2': ($(this).is(":checked"))
      }, function() {});
  })
  chrome.storage.sync.get('myonoffswitch2', function(storage) {
      $('#myonoffswitch2').prop('checked', (storage.myonoffswitch2 == true));
  });
  </code></pre>
  
  <p>})</p>
  
  <p>I am struggling to make the 'onoffswitch' turned ON as default upon initial Extension installation. 
  Whenever adding the Extension, the 'onoffswitch' is turned OFF, despite the declaration 'checked' in the 'checkbox' input under 'popup.html'. </p>
  
  <p>Thank you,
  Ido. </p>