Peekaboo…I See You

Hide and Seek - Peekaboo

In my last post, I addressed the styling of the DOM. I wanted to point out something additional in that same vein that I have found very helpful. As you saw previously, you can access pretty much any style via the DOM style property. One of the key ones I have found helpful is the visibility property. This allows you to show stuff to the end user or not.

Here is how this works…

[code lang=”js”]
document.getElementById(“someID”).style.visibility = “visible”;
[/code]

Again, I have found this useful over the years, so I thought I would share.

Happy Coding!

Clay Hess

More To Explore

Acronym DOM on wood planks
Code

A Friendly Introduction to the Document Object Model (DOM) API

The Document Object Model (DOM) is the browser’s in-memory representation of your HTML, letting JavaScript select elements (querySelector), listen to events (addEventListener), update content (textContent), toggle styles (classList), and create/insert nodes (createElement, insertAdjacentElement). With it, a button can change a box’s text, toggle a highlight class, set a data attribute, or insert a new paragraph right after the box—no page reload required—illustrating the simple flow: select, listen, update.

Share This Post

small_c_popup.png

Need help?

Let's have a chat...


Login

Jump Back In!

Here at Webolution Designs, we love to learn. This includes sharing things we have learned with you. 

Register

Begin Your Learning Journey Today!

Come back inside to continue your learning journey.