I am trying to set property to html element but getting an error Type 'HTMLCollectionOf' is not assignable to type 'HTMLElement'
Here is my typescript code---
let elem: HTMLElement= document.getElementsByClassName('notification-top-bar');
setTimeout(elem.setAttribute("style", "display:none;"), this.duration);
Here is my HTML code---
<div class="row">
<div *ngFor="let n of notifications" class="notification-top-bar" [ngClass]="type" style="display: block;">
{{message}}
<a class="close glyphicon glyphicon-close" (click)="onCloseNotifications($event)"></a>
<p>{{n}}</p>
</div>
</div>
HTMLElement