zoukankan      html  css  js  c++  java
  • js控制tr 隐藏 显示

    tr td 外面不要套div

    <tr>
                            <td>排期确定结果: </td>
                            <td> 
                               <label class="liradio">
                                    <input name="accreditInfo.status" value="5" type="radio" id="radioLab" onchange="thisTime()" />同意
                               </label>
                            </td>
                            <td> 
                               <label class="liradio">
                                    <input name="accreditInfo.status" value="4" type="radio" id="radioLab" onchange="otherTime()" />不同意
                               </label>
                            </td>
                        </tr>                    
                        <tr id="scheduleReply" style="display: none">
                            <td>排期反馈时间: </td>
                            <td colspan="2" >
                               <input id="scheduleDate" name="accreditInfo.scheduleReply" type="text"/>
                               <img onclick="WdatePicker({el:'scheduleDate'})" src="${pageContext.request.contextPath}/js/My97DatePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle">
                            </td>
                          
                        </tr>
                        <tr id="scheduleReplyRmark" style="display: none">
                            <td>备注: </td>
                            <td colspan="2" ><input type="text" id="confirmReason" name="accreditInfo.scheduleReplyRemark" style=" 150px;" vertical-align: bottom; margin-top: 5px;"/></td>
                            
                        </tr>            

    用js控制tr显现和隐藏时 用jQuery比较好 样式不会串 给你做了很多东西

    function otherTime() {    
        $("#scheduleReply,#scheduleReplyRmark").show();
        /* document.getElementById("scheduleReply").style.display = "block";
        document.getElementById("scheduleReplyRmark").style.display = "block"; */
    }
    function thisTime() {
            $("#scheduleReply,#scheduleReplyRmark").hide();
            /* document.getElementById("scheduleReply").style.display = "none";
            document.getElementById("scheduleReplyRmark").style.display = "none"; */
    }
  • 相关阅读:
    51nod1363-最小公倍数之和
    [模板] 数论题的一些经验
    WC2019游记 && 课件
    (伪)WC2019题解
    [模板] 后缀自动机&&后缀树
    [模板] 二分图博弈 && BZOJ2463:[中山市选2009]谁能赢呢?
    界面修改日志
    [模板] dp套dp && bzoj5336: [TJOI2018]party
    BZOJ1025:[SCOI2009]游戏
    [模板] BSGS/扩展BSGS
  • 原文地址:https://www.cnblogs.com/weixiaole/p/5045852.html
Copyright © 2011-2022 走看看