I'd like to hide/show a DIV
based on the state of a radio button.
I know I can add a listener to the radio button and show/hide it whenever it's selected or unselected (like this answer).
Is there a way to bind the Div
's display
attribute to the radio-button's :checked
attribute, something like $("#myDiv").visibility($("#myRadio").is('checked'));
?
In other words - can I data-bind the display/visibility to the radio button's state?
Maybe this can be done easily in css?