javascript - Checking dynamic Checkboxes on Change -
I have a dynamic table that can be filled with checkboxes that can not be checked or not. I've written a jquery script that changes the BG color of the table cell whenever any checkbox is modified; However, this is a very small cart and it does not always change BG color instantly.
Any suggestions?
checks var $ ('' [Id = = approvalcd] ') Change (function () {if ($ (this) .is (": checked")! = Check) {check = $ (this) .prop ("checked"); $ ('.provisionROW' + $ ( This) .prop ('id'). ('Approvalcd') [1]. CSS ('background color', color);} and {$ ('.provisionROW' $ (This) .prop ('id' ). Partition ('approvalcd') [1]) CSS ('background color', 'inherit');}});
HTML:
& lt; Td class = 'approvalROW'. $ Counter. ' & Gt; & lt; Input ID = 'acceptance CD'. $ Counter. '' Name = 'Acceptance CD' $ Counter. '' Type = 'checkbox'>
I think the use of classes is more flexible: ('change', ': checkbox', function () {$ (this) .clostest ('tr'). ToggleClass ('Selected', this.checked).;}). Search (': checkbox') Trigger ('change');
For example:
Comments
Post a Comment