I'm trying to see if a checkbox is checked or not with a simple function. It doesn't seem to be working, here's the code:
HTML:
<form>
<input type="checkbox" id="check" />
</form>
JS:
$(document).ready(function() {
if ($('#check').is(":checked")) {
alert('it works')
}
});
JSFiddle: https://jsfiddle.net/5h58mx1h/