For some reason, the following code does not work properly:
<input onclick="$(function(){ alert($(this).attr('checked')); })" name="step1[agree]" id="step1_agree" value="1" type="checkbox">
It alerts with undefined. I have also tried doing something like this:
onclick="$(function(){ var chk=$(this); alert(chk.attr('id')); })"
... but ends up with the same result. What am I doing wrong and how can I fix this?