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

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -