我在选择特定复选框并将其 div 的高亮 css 放入 mysql_fetch_array 时遇到问题
这是我的代码
$count=1;
$query = mysql_query('SELECT * FROM thread');
while($row = mysql_fetch_array($query))
{
echo "<div class='row".$count."'><input type='checkebox' class='chk_box".$count."'> ".$row['title']."</div>";
$count++;
}
<script>
var count= "<?php echo $count?>";
for(var y=1;y<=count;y++){
$('.chk_box'+y).click(function() {
if(this.checked) {
$('.row'+y).addClass('backcolor');
}
else{
$('.row'+y).removeClass('backcolor');
}
});
}
</script>