Blinking element Javascript

This is an html div element:

<div id="elem">A blinking element</div>

This is the Javascript code:

let elem = document.getElementById("elem");
setInterval(() => elem.hidden = !elem.hidden, 1000);

The code is to make the element blink after a second, why is the function in setInterval elem.hidden = !elem.hidden what does it mean, I mean the function

158 thoughts on “Blinking element Javascript”

Leave a Comment