2

I have this script

$('[data-toggle="wizard-checkbox"]').click(function(){
    if( $(this).hasClass('active')){
        $(this).removeClass('active');
        $(this).find('[type="checkbox"]').removeAttr('checked');
    } else {
        $(this).addClass('active');
        $(this).find('[type="checkbox"]').attr('checked','true');
    }
});

He add checked="checked" but radio or checkbox is still unchecked and Request:All in Laravel dont see this. How to edit this to do this checked?

1 Answer 1

1

You want to use .prop().

// Check all checkboxes found
jQuery('[type="checkbox"]').prop( "checked", true );

// Uncheck all checkboxes found
jQuery('[type="checkbox"]').prop( "checked", false );

For more details read the jQuery docs on .prop()

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.