javascript - Change CSS with jQuery within a PHP While Loop -
i've been trying figure 1 out while now, , have gone through series of methods however, no cigar. q: how change color of singular div within php while loop, using jquery following ajax response? garr! this jquery function within response: $('.circle').each(function(){ $(this).css("background", "red"); }); in php file if status there echo div, when jquery triggered response affects $red variables, rather 1 i'm trying target. test2.php: $red = "<div id='basic' class='circle' style='display: block; border-radius: 100%; width: 60px; height: 60px;' value='1'></div>"; if($row2['status'] == 1 || 0){ echo $red; } it's frustrating because works fine if echo variables depending on data id different background colors , display: none , it'd nice working without refresh using jquery method. ajax , jquery synchronous. try setting funct