You can use starts with selector like this:
$('a[class^="rotate-"]')
Description: Selects elements that have the specified attribute with a value beginning exactly with a given string.
So your code should be:
$('a[class^="rotate-"]').click(function(){
// do stuff
});
Note: If you want to find out elements that contain certain text anywhere in their attributes, you should do this instead:
$('a[class*="rotate-"]').click(function(){
// do stuff
});