how to make div visible and invisible in javascript 1

how to make div visible and invisible in javascript

elem.style.display = 'none'; // hide
elem.style.display = 'block'; // show - use this for block elements (div, p)
elem.style.display = 'inline'; // show - use this for inline elements (span, a)

Here is what the above code is Doing:
1. We’re selecting the element with the id of “my-element”.
2. We’re setting the display property to none.
3. We’re setting the display property to block.
4. We’re setting the display property to inline.

Similar Posts