Issue
I want to assign some value where the class name is "grid-filter" but it's giving a compilation error in the angular typescript.
code
document.getElementByClassName('grid-filter')[0].title='new title';
Solution
You need to cast the element returned to an array of HTMLElement
since you're selecting by class name:
(document.getElementByClassName('grid-filter') as HTMLElement[])[0].title = 'new title';
Answered By - Brandon
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.