i have the following html code and i want to add on click the class "rotate" (which i have included in my css) to the div with class "barklogo"
<div class="barklogo loaded" data-width="40" data-anim="left">
<img src="/images/home/button.png" border="0" alt="Demo image">
</div>
I found a similar post here
JQUERY - add CSS class to BUTTON element after click
But when i enter the following code to the js file it won't work
$(document).ready(function(){
$('barklogo').click(function(){
$(this).addClass('rotate');
});
});
Here is the css code for the class .rotate
.rotate{
transform: rotate(360deg);
-webkit-transform: rotate(360deg);
-moz-transform: rotate(360deg);
-o-transform: rotate(360deg);
-ms-transform: rotate(360deg);
}
Thank you very much!