I want to change the the styling of an element with a function like this one
function changeStyle(element)
{
element.style.color = 'red';
element.style.marginLeft = '50px';
element.style.opacity = 0.5
}
Without using setTimeOut
, is there a way i can make the next change only after the previous change has taken effect? I tried using promises but all the changes still happen at the same time.