I need to rotate an image with javascript in 90-degree intervals. I have tried a few libraries like jQuery rotate and Raphaël, but they have the same problem - The image is
var angle = 0; $('#button').on('click', function() { angle += 90; $('#image').css('transform','rotate(' + angle + 'deg)'); });
Try this code.