Here is a function:
- $(document).ready(function () {
- $("input.commentBox").click(function () {
- if ($(this).closest('div.editor-field2').children('input:checked').val() == "True") {
- $(this).closest('div.formQuestion').children('div.hidden').slideDown(800);
- } else {
- $(this).closest('div.formQuestion').children('div.hidden').slideUp("fast");
- }
- });
- });
It works great if the input item is a radio button, but if I change it to a checkbox with the same class name .commentBox it no longer works. Can someone esplain to me way?
Thank you for reading my post.