I am trying to achieve this (90 degree rotation), but it fails without errors.
This image is within a <a></a> TAG where it has already a toggle jquery function.
<?php echo "<img src='down_arrow.png' onclick='$(this).animate({rotate: \"+=90deg\"});' />"; ?>
Consider a jQuery extension such as: jQueryRotate
It’ll make the rotating inside the onclick much easier and more readable.