I want to rotate my element using javascript. My method for rotation:
function AnimateSidebar(sidebar) {
sidebar.style.width = "20%";
let arrow = document.getElementById("arrow");
arrow.style.transform = "rotate(60deg);";
arrow.style = "tranform(rotate(60deg));";
arrow.style.mozTransform = "rotate(60deg);";
arrow.style.msTransform = "rotate(60deg);";
arrow.style.oTransform = "rotate(60deg);";
arrow.style.webkitTransform = "rotate(60deg);";
arrow.style = "margin-left:85%;margin-right:0;";
}
I tried to rotate it in several ways, as you can see above, but nothing works. The last line of code to change the margin of the arrow element works fine.
My css for the arrow element: (the initial rotation in css file works ok)
#arrow{
transform:rotate(20deg);
transition:0.8s;
}
My browser is Microsoft Edge.
EDIT: Solved. I had to put the margin property above the tranform property.