title: Gracefully handling checkboxes
body: <p>I have some javascript that I am currently working on that checks for the existence of a check in a check box. This javascript code is more or less horribly written and we do the check multiple times in multiple places in the code to see if the check box was checked or not. I am asking if there is a graceful way to set a master override for check box options that only gets checked once to both improve performance and to keep the code DRY. Basically right now for every place that it needs checked I go to </p>
  
  <pre><code>if($("#element").attr("checked")){ 
      do something... 
  } else {
      do something else...
  }
  </code></pre>
  
  <p>I'm a bit of noob with javascript so I was wondering about this more as a best practice question. </p>