Simple code works in JSFiddle but not on a page
I have a simple Confirm on a tick box -
http://jsfiddle.net/apWUj/1/ - but on a page on my server nothing.
Am I mssing some thing that JSFiddle includes - a wrapper of some sort
<html>
<head>
<link type="text/css" href="css/ui-lightness/jquery-ui-1.8.10.custom.css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery-1.8.2.js"></script>
<script>
$('input.delcal:checkbox').click(function(){
var checked = $(this).is(':checked');
if(checked) {
if(!confirm('Are you sure you want to resume use of this program?')){
$(this).removeAttr('checked');
}
} else if(!confirm('Are you sure you want to discontinue this program?')){
$(this).attr("checked", "checked");
}
});
</script>
</head>
<body>
<div>
<table>
<tr>
<td align="center">
<input type="checkbox" name="chkdelrow" id="chkdelrow" class="delcal">
</td>
</tr>
</table>
</div>
</body>
</html>