javascript - Change the value of a checkbox inline using the onChange attribute -
am doing wrong or impossible? want set value of checkbox "0" if unchecked, , "1" if checked
<input type="checkbox" onchange="function() {$(this).val(this.checked? '1': '0')};" />
note: know how outside of onchange
event or doing onchange="takecareofthis()"
, i'm looking inline
you need set statement executed.
<input type="checkbox" onchange="$(this).val(this.checked? '1': '0');" />
Comments
Post a Comment