title: function(event) vs function() in jquery
body: <p>I am new to Jquery.I am little bit confused on a jquery snippet.I have a checkbox for selecting all other checkboxes under it after clicking the main checkbox.the code is like this:</p>
  
  <p>Jquery:</p>
  
  <pre><code>$(document).ready(function() {
  $('#selecctall').click(function() {  //on click 
      if(this.checked) { // check select status
          $('.checkbox1').each(function() { //loop through each checkbox
              this.checked = true;  //select all checkboxes with class "checkbox1"               
          });
      }else{
          $('.checkbox1').each(function() { //loop through each checkbox
              this.checked = false; //deselect all checkboxes with class "checkbox1"                       
          });         
      }
  });
  
  });
  </code></pre>
  
  <p>Html:</p>
  
  <pre><code>&lt;ul class="chk-container"&gt;
    &lt;li&gt;&lt;input type="checkbox" id="selecctall"/&gt; Selecct All&lt;/li&gt;
    &lt;li&gt;&lt;input class="checkbox1" type="checkbox" name="check[]" value="item1"&gt; This is   Item 1&lt;/li&gt;
    &lt;li&gt;&lt;input class="checkbox1" type="checkbox" name="check[]" value="item2"&gt; This is Item 2&lt;/li&gt;
    &lt;li&gt;&lt;input class="checkbox1" type="checkbox" name="check[]" value="item3"&gt; This is Item 3&lt;/li&gt;
    &lt;li&gt;&lt;input class="checkbox1" type="checkbox" name="check[]" value="item4"&gt; This is Item 4&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>My confusion is that when I used <strong>$('#selecctall').click(function()</strong> statement,it works as same as that of <strong>$('#selecctall').click(function(event)</strong>.So may I know which way of calling the event is better. </p>