用radio控制的隐藏和显示问题时间:2022-05-22 17:11:02jsp页面代码 <tr> <th nowrap="nowrap" width="10%" height="50px" style="text-align: center;">是否评估通过</th> <td width="40%"> <input type="radio" id="yesorno" name="yesorno" value="1" onclick="yes()">是</input> <input type="radio" id="yesorno" name="yesorno" value="0" onclick="no()" selected = "false">否</input> </td> </tr> <tr id="third" > <th nowrap="nowrap" height="50px" style="text-align: center;">指派第三方机构</th> <td> <input id="ThirdPart" name="ThirdPart" class="easyui-combobox input160" data-options="valueField:'id',textField:'text',editable: false, panelHeight: 120, url:'${ctx}/rescue/surver/send/comlist.action?code=${userDep.sysDepartment.sysDepartmentId}',method:'get'" /> </td> </tr> <tr id = "reason" style="display: none"> <th nowrap="nowrap" height="100%" style="text-align: center;">退回原因</th> <td> <textarea id="reason" name="reason" class="easyui-validatebox" cols="157" data-options="required:true, validType: 'length[0,500]'" maxlength="500"></textarea> </td> </tr> tr js代码 //显示第三方机构 function yes(){ $("#reason").css('display', 'none'); $("#third").css('display', 'block'); } //显示退回原因 function no(){ $("#third").css('display', 'none'); $("#reason").css('display', 'block'); } js 相关文章jQuery控制TR显示隐藏的三种常用方法用switch组件控制一个元素的显示和隐藏状态上一篇:反思个人发展方向下一篇:在C中定义16位整数