|
|
|
|
|
by codazoda
3107 days ago
|
|
That's actually a good example. My gut feeling was simply to write the following. document.getElementsByClassName("my-class")[0].style.display = 'block'; The PlainJS site mentions that it's not quite that simple and suggests writing your own show() and hide() functions if you're avoiding jQuery. https://plainjs.com/javascript/effects/hide-or-show-an-eleme... |
|
[0] https://en.wikipedia.org/wiki/Greenspun%27s_tenth_rule