Checkbox toogle value


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <script type="text/javascript">
  2. $('#id').change(function () {
  3. if ($(this).attr("checked"))
  4. {
  5. $('#id').attr("value", 'ja')
  6. return;
  7. }
  8. $('#id').attr("value", 'nein')
  9. });
  10. </script>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.