Black Lives Matter. Please consider donating to Black Girls Code today.

Detect on javascript when the dash components loaded

I want to detect the existence of a Html tag on JS using his ID, but when I call getElementById() function I got undefined. How to execute js code when elements of dash has been rendered?

for now, i believe the best solution is to poll with setInterval