RADIOラジオボタンは2つあり、どちらか一方のRADIOをクリックすると、もう一方のRADIOは選択不可(グレー)になります.
1508 ワード
<style>
ul li ,ul{
padding:0;
margin:0;
list-style-type: none;
}
</style>
<form method="POST" action="--WEBBOT-SELF--">
<div style="position: absolute; width: 180px; height: 399px; z-index: 1; left: 10px; top: 15px" id="layer1">
<ul>
<h2> </h2>
<li><input type="RADIO" id="s1_1" name="s1" value="1"> </li>
</ul>
</div>
<div style="position: absolute; width: 180px; height: 399px; z-index: 1; left: 200px; top: 15px" id="layer2">
<ul>
<h2> </h2>
<li><input type="RADIO" id="s1_2" name="s1" value="1"> </li>
</ul>
</div>
<div style="position: absolute; width: 180px; height: 399px; z-index: 1; left: 390px; top: 15px" id="layer2">
<ul>
<h2> </h2>
<li><input type="RADIO" id="s1_3" name="s1" value="1"> </li>
</ul>
</div>
</form>
<script>
document.onclick=function che_(){
o=event.srcElement;
if (o.tagName=='INPUT'&& o.type=='radio'){//
for (i=0;i<=document.getElementsByName(o.name).length-1;i++){
if (document.getElementsByName(o.name)[i].id!=o.id)
document.getElementsByName(o.name)[i].disabled=(o.checked)?"none":''
}
}
}
</script>