A checkbox, if it is the only one regarding a question, can be an acceptable toggle. Unlike anchors or buttons, checkboxes and radio buttons have a state, which can be nice. I have used plain anchors/buttons for toggling boxes being tall or short-- in that case, the button doesn't check the state of the box, but merely mindlessly sets the new height (since CSS is idempotent here-- if my height is already 6em, setting it to 6em again won't break anything).
If it helps the user to see what the current state is, though, a checkbox or radio button (depending on the setup) could be a better choice than Some Other Random Clickable Thingie. You can also have a <select> with two <option>s as well, with an onchange() listener.
then undoing it
should give you the following HTML
<div id="box" style="background-color: ' ' ";>filler</div>
and so the original CSS styles should then be seen. If there weren't any styles set in CSS, the default stylesheet is used:
browser x sets <div>s to display: block without you needing to.
document.getElementById('box').style.display=""; //div should now be block.
Not that setting things to empty strings solves the problem you want solved-- remove code redundancy.