Two images, placed by php:
echo "<img onclick='test()' src=\"/img/Sun.png."\">";
echo "<img onclick='test()' src=\"/img/Moon.png."\">";
$x = "Sun.png";
js:
function test(){
if (clicked_image_name == $x) ...do something
So, how to get the name of clicked image, and how to compare it with a php variable ?