jquery - changing colour of parent element of unchecked checkbox -


i'm using jqgrid , have many checkboxes there, value puller database:

<td role="gridcell" style="text-align:center;" title="" aria-describedby="schedule_1st draft ?">     <input type="checkbox" value="0" offval="no" disabled="disabled"></td> <td role="gridcell" style="text-align:center;" title="" aria-describedby="schedule_art work ?">     <input type="checkbox" value="0" offval="no" disabled="disabled"></td> <td role="gridcell" style="text-align:center;" title="" aria-describedby="schedule_on sys ?">     <input type="checkbox" checked="checked" value="1" offval="no" disabled="disabled"></td> 

after grid loaded, want change background colour of cells checkboxes of unchecked. i'm trying:

if ($("input:checkbox:not(:checked)")) {         $(this).parents().css('background-color', '#666');     }  

but nothing gets changed.

any better suggestions please?

try this:

$("input:checkbox:not(:checked)").parent().css('background-color', '#666'); 

Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

php - joomla get content in onBeforeCompileHead function -