Hi Jeriel,
Am I correct in thinking that you want to hide the buttons according to input provided?
In that case I would suggest giving them a class 'hidden' whenever the input is false.
Hidden in this case would be defined as " button .hidden { display:none} ".
In this case you won't be needing to run javascript actions everytime the screen is redrawn.
It will also make it easier to toggle between hidden and not hidden.
Negative part however is that the buttons are still in the DOM only not visible to the users, which is enough for most purposes, since this is not really a security issue.
If you really want them gone though have a look at the remove node:
https://developer.mozilla.org/en-US/docs/Web/API/ChildNode/remove
Kind regards,
Alexander