I want to set style top for some elements using typescript
for(var i=0; i< document.getElementsByClassName('calendar-event').length; i++){
document.getElementsByClassName('calendar-event')[i].style.top = 50*i;
}
This returns error Property 'style' does not exist on type element. How to make this work in typescript??
You can use setAttribute as below