Cookie consent box on button click
IDs
Avoid IDs for styling. It's ok to use them to identify elements with JavaScript, but the specificity in CSS can make structuring the styles tricky.
Names such as buttons, yes and no are very generic, that could easily be needed more than once in a document.
Also try to be more consistant with the style of classes/names/IDs. For example, shownotice has no underline, but consent_notice does. Consider using hyphens instead of an underlines in order to match the general style of CSS, which uses hyphens, as in background-color.
HTML
&quot;true&quot; is not a valid value for the attribute for the attribute hidden. As a boolean attribute hidden is either present without a value (or, if you prefer use the value &quot;hidden&quot; as in hidden=&quot;hidden&quot;) or not present. hidden=&quot;false&quot;, for example, would still hide the element.
JavaScript
Declare your variables with const or let (or var if you need to support very old browsers).
In JavaScript it is convention to write variable names in camelCase and not with underlines.
You could be more consistent when retrieving elements by ID and use either querySelector or getElementById, but not both.
Don't use on... properties to assign event handlers. Use addEventListener.
Use the boolean negator ! to toggle boolean values:
consent_elem.hidden = !consent_elem.hidden;