jQuery only affects the last result in a while loop: MySQL
问题 I am trying to make the background color change for each checked item in a row in a while loop. Currently the jQuery only works on the last row. I did put an $i variable in the input id, but to be honest, I'm not sure what to do beyond it. I tried this, the .each function, and a bunch of answers on Stack Overflow, but I can't figure out how to take care of this. Here is the jQuery: $(document).ready(function(){ $('#org[$i]').change(function(){ if(this.checked){ $(this).siblings('table')