Loading elements with a button

I am trying to display some elements in a template file when a user clicks a button, specifically an image gallery and another separate template part. The following doesn’t break the site but doesn’t work either,

It needs some magic sauce to force it to actually display.