1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
<html> <head> <script type="text/javascript"> <!-- function checkradio() { obj = document.userform.radiobox; for (i = 0; i < obj.length; i++) { if (obj[i].checked) { if(obj[i].value == "1"){ document.getElementById('displayblock').style.display = 'block'; }else if(obj[i].value == "0"){ document.getElementById('displayblock').style.display = 'none'; } } } } // --> </script> </head> <body onLoad="checkradio()" > <form action="#" method="POST" name="userform"> <label><input type="radio" name="radiobox" value="1" onclick="checkradio()" >表示する</label><br> <label><input type="radio" name="radiobox" value="0" onclick="checkradio()" >表示しない</label><br> <div id="displayblock"> 対象のコンテンツ </div> </form> </body> </html> |