Hide Block with a Button?

Hello, All -

I’m just thinking outside the box here but would it be possible to switch off a block with a button? I am trying to complete every part of my main site design using GP and GB. The only thing that presents a problem is the cookie consent notice which UK sites are obliged to show. I can create the notice using a block and tack it on to the bottom of the site. All I need then is a way to switch it off and prevent it from showing again.

Could it be done? I’m loath to use a plugin for this if possible.

Antar

Not fully tested - but maybe this will give some direction: