i have been trying to make this work so i come here asking for help... i managed to make a so called paging , the script gathers data from a mysql database and displays them on the page and makes paging the links ( page: 1 2 3 and so on ). what i have been trying to do this whole day is that when page 2, for example, is clicked, the color would change . to be more specific here is the code: //gathering the requierd data from the database $count = mysql_query("SELECT COUNT(*) FROM games WHERE game_type=$gt"); $nog = mysql_fetch_row($count); $x=$nog[0]/16; //starting a div and a table echo "<div id='page' align='center'>"; echo "<table border='1' class='nr' >"; echo "<td class='nrp'>Page: </td>"; //the links generator $n=1; for ($i=1; $i<= ceil($x); $i++) { if ($i > 1) $n=$n+16; echo "<td id='navigationDiv' width='10px' height='10px'><a onclick='highlightLinks(this)' class='' href='showallt.php?offset=$n&order=game_type&game_type=$gt' >"; echo $i; } echo "</a></td>"; //and the rest of the code from here down wich is not important PHP: i have tried to make a background variable for the <td> in the loop with all sorts of code, but well... my ideas did not work and i did not find much on google regarding the actual color on the links when creating pagination you would observe in the loop near <a there is a onclick function, that's an idea i got from google when trying to find an answer, i tryed to change the css class of the <td> and the <a> when the link was clicked, using javascript ... but it did not work because the page reloads or a new page loads so the css class goes back to the inital value. Any buddy can help me