A quick javascript question on hidden HTML elements

I have a javascript function on my HTML page that periodically assigns content to a DIV. This I am doing with a timer (setTimeout).

If under certain circumstances, display of the DIV is set to ‘none’ or the visibility is set to ‘hidden’, how does Javascript handle it?

I should probably figure out a way (test for the display status of the DIV) to not invoke the JS when the DIV is hidden. Thank you for your help.

Set the div can solve your problem, no need to use js

The element is still in the HTML and so JavaScript can update it. That the CSS hides it from being displayed makes no difference.