I want to rotate this div on click, when it's clicked it had to stay in the rotated state(45deg). but when you click again it will go back to the original rotation(0deg).
This is my code right now, maybe someone can help me!?
JSFIDDLE:
https://jsfiddle.net/sz2yfr51/2/
CODE:
var boxopen = document.getElementById('boxopen');
boxopen.addEventListener("click", function(){
boxopen.style.animation = "rotate 2s";
boxopen.style.webkitAnimation = "rotate 2s";
});