I can't figure this one out. According to W3 Schools, the checked property sets or returns the checked state of a checkbox.
So why does $('input').checked ? $('div').slideDown() : $('div').slideUp();
not work?
Using prop however, does work.
$('input').prop('checked') ? $('div').slideDown() : $('div').slideUp();
This is for a checkbox that is checked based on a database value.
See Question&Answers more detail:os