I have hidden two parts of code and created two radio buttons.
I would like to unhide the first part if radio button 1 is selected but hide it again when radio button 2 is selected and unhide the second hidden part. And vice versa without using a submit button.
I have looked at other questions about radio buttons and/or hiding and unhiding html code but most of the time the code from the asker is so extreme long, I am not seeing the complete picture.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>How to make a part of the website unhidden by only clicking a radio button</title>
</head>
<body>
<!-- Radio Buttons to choose which part should be visible -->
<input type="radio" id="option_1" name="options" value="option_1">
<label for="option_1">Option 1</label><br>
<input type="radio" id="option_2" name="options" value="option_2">
<label for="option_2">Option 2</label><br><br>
<!-- Hidden part #1 -->
<div hidden class="hidden_part_1">This turns visible by selecting radio button with Option 1</div>
<!-- Hidden part #1 -->
<div hidden class="hidden_part_2">This turns visible by selecting radio button with Option 2</div>
</body>
</html>