I'm trying to disable a checkbox in the checkbox list using jQuery. But it doesn't seem to work. Here's the code. The checkbox list has a total of 12 checkboxes.
<script src="../AutoComplete Jquery/jquery-1.7.2.min.js" type="text/javascript">
</script>
<script type="text/javascript">
$(document).ready(function()
{
var disable = 5;
var i=0;
$(":checkbox").each(function()
{
if(i<disable)
{
$(this).attr("disabled", "disabled");
i=i+1;
}
});
});
</script>