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

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -