HTML表多个radio
<table class="commTable searchArea">
<tr>
<th style="width:17%">递增拆分</th>
<td>
<input type="radio" name="radio" id="radio" value="radio" onclick="$('#tab2').show()"/>
</td>
<th>平均拆分</th>
<td><input type="radio" name="radio" id="radio2" value="radio" onclick="$('#tab3').show()" /></td>
<th> </th>
<td> </td>
</tr>
</table>
<table class="commTable searchArea" id="tab2" style="display:none">
<tr>
<th width="398" style="width:17%">样品清单拆分行数</th>
<td width="95"><input name="breed2" type="text" class="inputSytle i40px" id="breed2" value="3"/></td>
<th width="91">初始数量</th>
<td width="83"><input name="breed5" type="text" class="inputSytle i40px" id="breed5" value="350"/></td>
<th width="84">递增数量</th>
<td width="93"><input name="breed6" type="text" class="inputSytle i40px" id="breed6" value="50"/></td>
</tr>
</table>
<table class="commTable searchArea" id="tab3" style="display:none">
<tr>
<th width="398" style="width:17%">样品清单拆分行数</th>
<td width="95"><input name="breed2" type="text" class="inputSytle i40px" id="breed2" value="3"/></td>
</tr>
</table>
当我选择平均拆分时,出现TAB2,选递增拆分,TAB3出现,但是TAB2不隐藏,请问怎么办?
答案:你不写js隐藏难道会自动隐藏啊!js中写显示一个标签的同时,也需要同时写隐藏其他不需显示的,$('#tab2').show();$('#tab3').hide();
上一个:在html中,3个框架并排,且都能自适应各自嵌入的页面的高宽
下一个:html代码在什么环境下才能运行