Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change prettyCheckable checkbox with jquery (check and uncheck)

How do i change prettyCheckable checkbox with jquery, to check and uncheck? I tried everything.. Actually i'm able to change, the checkbox checks and unchecks, but visually doesn't change.. I tried numerous ways:

$('#part_PAC-050-0142').attr('checked', true); 
$('#part_PAC-050-0142').attr("checked","checked");
$('#part_PAC-050-0142').prop("checked", true).change();
$("ul > li > div > href", "#radio_parts").addClass("checked");
$('#part_PAC-050-0142').addClass("checked", true);
$('#part_PAC-050-0142').triggerHandler("click");

$('input.prettyC').prettyCheckable();

None of this worked, none changed visually the prettyCheckable checkbox..

like image 419
migascsi Avatar asked Oct 21 '22 01:10

migascsi


1 Answers

You can use pretty checkable functions:

$('#part_PAC-050-0142').prettyCheckable('check');

and

$('#part_PAC-050-0142').prettyCheckable('uncheck');
like image 119
kravits88 Avatar answered Oct 27 '22 10:10

kravits88