我有一个jsp文件:
<div class="span12" id="result" style="position: relative; top:-57px;margin-left:-10px">
Is The Image Missing or Wrong?
<table>
<tr>
<td>
<input type="radio" name="imageprob" value="Missing" onclick="MissingSelected()">
Missing
<br>
<input type="radio" name="imageprob" value="Wrong" onclick="WrongSelected()">Wrong
</td>
<td></td> //content of this column to be set based on which radio button slected
</tr>
</table>
</div>
</div>
我想根据在第一列中选择哪个单选按钮来设置表中第二列的内容。我该怎么做?
试试这个兄弟| 检查这个 演示
的HTML
<div class="span12" id="result" style="position: relative; top:-57px;margin-left:-10px">
Is The Image Missing or Wrong?
<table><tr>
<td><input type="radio" name="imageprob" value="Missing" onclick="selected(this)"> Missing
<br>
<input type="radio" name="imageprob" value="Wrong" onclick="selected(this)">Wrong</td>
<td id="set"></td> //content of this column to be set based on which radio button slected
</tr></table>
</div>
</div>
JS
function selected(dis)
{
var ele= document.getElementById('set');
if(dis.value =='Missing')
{
ele.innerHTML ="MIssing something";
}
else
{
ele.innerHTML ="Correct";
}
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句