I would like to toggle my button text with “Show” and “Hide” while showing and hiding objects using class names. Here is what I have so far on the button click:
var elements = document.getElementsByClassName(‘bricks’);
for (var i = 0; i < elements.length; i++) {
elements[i].style.display = elements[i].style.display == 'block' ? 'none' : 'block';
}
Hi Jim, yes this is perfect! Thank you so much. I’m a designer first so coding is fairly new to me. Love the awesome Hype community. Hopefully some day I will be able to help someone else out.