I am building out a page for work that has a section where the content needs to change dynamically on button(s) click. I know of several different ways to accomplish this bu
You could potentially use CSS's :target pseudo-class selector. This would require replacing your buttons with a elements instead, which cause your document's URL to apply a hash relating to the id attribute of the element you want to change.
div {
display: none;
}
:target {
display: block;
}
Click here to show the hidden div element
Click here to hide it again.
This should only show when the link is clicked.