property 27style 27 does not exist on type 27element 27

Solutions on MaxInterview for property 27style 27 does not exist on type 27element 27 by the best coders in the world

showing results for - "property 27style 27 does not exist on type 27element 27"
Chiara
01 Jul 2018
1// Cast to the type of `HTMLElement`
2const el = document.getElementById('whatever') as HTMLElement;
3el.style.paddingTop = ...;
4
5// Or, if it is an array
6const els = document.getElementsByClassName('my-class') as HTMLCollectionOf<HTMLElement>;
Rafaela
13 Aug 2016
1const node = document.querySelector<HTMLElement>(element);