onclick not worked as expected with jquery
<p>Here is the sample code..if I comment out the script it will call server side function on button click. what will be the error in following code??</p>

<pre><code>&lt;form id="form1" runat="server"&gt;    
   &lt;input type="checkbox" id="chb1" value="Hourly" /&gt;
   &lt;input type="checkbox" id="chb2" value="Daily" /&gt;
   &lt;input type="checkbox" id="chb3" value="Weekly" /&gt;
   &lt;input type="checkbox" id="chb4" value="Monthly" /&gt;
   &lt;input type="checkbox" id="chb5" value="Yearly" /&gt;

  &lt;asp:Button Text="submit" runat="server" ID="btnSubmit" OnClick="btnSubmit_Click"/&gt;
&lt;/form&gt;
&lt;div&gt;&lt;/div&gt;

&lt;script src="https://code.jquery.com/jquery-1.10.2.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;

        var selectedcout = 0;

        var countChecked = function () {
            var n = $("input:checked").length;                
            $("div").text(n + (n === 1 ? "is" : "are") + "checked");
        };
        countChecked();

        $("input[type=checkbox]").on("click", countChecked);

&lt;/script&gt;
</code></pre>