function change() {
let image = document.getElementById("rotZ");
let transform = image.style.transform;
let rotateValue = 0;
if (transform) {
rotateValue = parseInt(transform.replace(/[^0-9]/g, ''));
}
if (rotateValue === 0) {
image.style.transform = "rotate(" + 90 + "deg)";
}
}
Помогите пж, 3 часа думаю
Пока так