I want to change the -webkit-transform: rotate()
property using JavaScript dynamically, but the commonly used setAttribute
is not working:
img.setAttribute('-webkit-transform', 'rotate(60deg)');
The .style
is not working either...
How can I set this dynamically in JavaScript?
The JavaScript style names are WebkitTransformOrigin
and WebkitTransform
element.style.webkitTransform = "rotate(-2deg)";
Check the DOM extension reference for WebKit here.