funtion that generate a red div and rotate it constantly dynamically
function change() { var b = document.getElementById("div1"); b.style.transform = "rotate(30deg)"; b.style.transitionDuration = "3s"; setTimeout(change2, 3000); } function change2() { var b = document.getElementById("div1"); b.style.transform = "rotate(0deg)"; b.style.transitionDuration = "3s"; setTimeout(change, 3000); }