Radio選項按鈕與hidden功能

Radio選項按鈕,點選選項按鈕一隱藏div id="test"資訊;點選選項按鈕二則顯示div id="test"資訊。

HTML5:

<input type="radio" id="radio1" name="radio" value="RADIO1" style="cursor:pointer;" onclick="choose_radio1()">
<label for="radio1" style="font-weight:bold;">RADIO1</label>&emsp;&emsp;&emsp;
<input type="radio" id="radio2" name="radio" value="RADIO2" style="cursor:pointer;" onclick="choose_radio2()">
<label for="radio2" style="font-weight:bold;">RADIO2</label><br>
<div id="test">123</div>

JavaScript:

function choose_radio1() {
	document.getElementById("test").hidden=true;
}
function choose_radio2() {
	document.getElementById("test").hidden=false;
}