Last active
June 25, 2020 01:38
-
-
Save Fobiya/0306cbc720b9d6a25588585aae24554c to your computer and use it in GitHub Desktop.
checkbox
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.check').click(function(){ | |
this.value = (this.value)?'':this.dataset.check; | |
}); | |
$( document ).ready(function() { | |
$('input[type="checkbox"]').click(function() { | |
if ($(this).val() === '') { | |
$(this).val($(this).data("check")); | |
} else { | |
$(this).val(""); | |
}; | |
}); | |
}); | |
$( "select" ) .change(function () { | |
$('select option').val(''); | |
$( "select option:selected" ).each(function() { | |
$(this).val($(this).data("select")); | |
}); | |
}) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment