working on some html/css/php/js/sql project and faced the problem - i cant change style of PHP/SQL-generated links, i want to change background of link if its clicked and not changing it after page refresh. I tried different methods including ajax query, but it changes style of every link at same time and lasts on page refresh
PHP file:
if (isset($_GET['move'])) {
$swi = $_GET['move'];
$query = "INSERT INTO done
SELECT * FROM tasks WHERE keycode=$swi";
mysqli_query($sql, $query) or
die(mysqli_error($sql));
}
foreach ($data as $elem) {
$datef = explode('-', $elem['date']);
$dayf = intval($datef[0]);
$monthf = intval($datef[1]);
if ($monthf==12){
$monthf=0;
}
$result .= '<div class="taskboxitem" style="color: #fff">';
$result .= '<div class="taskboxhead">'.$dayf.' '.$month[$monthf].'</div>';
$result .= '<div class="taskboxcontent">' . $elem['task'];
$result .= '<div class="taskdelete">
<a href="?del='. $elem['keycode'] . '">
<ion-icon class="icon" name="trash-outline"></ion-icon>
Delete</a>
<a href="?move='.$elem['keycode'].'" class="move" onclick=""> //need this link to change style
<ion-icon name="checkmark-circle-outline"></ion-icon>Done</a>
</div></div>';
$result .= '</div>';}
echo $result;