Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

typescript document.getelementbyid object is possibly null

`document.getelementbyid` is used to get a specific element by a specified ID.
BUT if the element does NOT existwith said ID then the returned value will be `null`.
make sure you have such element with said ID or do an if check before running your logic to ensure the value is not `null`
 
PREVIOUS NEXT
Tagged: #typescript #object #possibly #null
ADD COMMENT
Topic
Name
9+2 =