I'm trying to figure out a code where if one or more checkbox is checked through a form submit, they would show their content. I'm close to doing it but the code only works in single instead of multiple checks. The content also gets stuck even though it's been unchecked after it's checked.
$(document).ready(function(){
$(function(){
$('form').submit(function(e){
e.preventDefault();
if ($('.checkEdu').is(':checked'))
{ $('#education').show();
} else if ($('.checkWork').is(':checked')){
$('#experience').show();
} else if ($('.checkAbout').is(':checked')){
$('#about').show();
}
else {
$('#education').hide();
$('#experience').hide();
$('#about').hide();
}
});
});
});
This is the code I tried. Thanks
$(document).ready(function() {}and$(function() {}do the same thing.