本篇文章主要是對tr的隱藏和顯示問題進行了詳細的介紹,需要的朋友可以過來參考下,希望對大家有所幫助
代碼如下: var ReturnrReason=function(){ if($('#nextTransaction1 option:selected').text()=="退回制作附件"){ $("#ReturnrReason").css('display' ,''); $("#ReturnrReasonNote").css('display' ,''); }else{ $(":checkbox[name='workFlowParam.annexReturnReason']").attr("checked",false);//清空選項 $("#ReturnRemarks").val(""); $("#ReturnrReason").css('display', 'none'); $("#ReturnrReasonNote").css('display' ,'none') } } 代碼: 代碼如下: <tr id="ReturnrReason" style="display: none"> <td>附件退回原因</td> <td colspan="3" > <caf:checkboxlist name="workFlowParam.annexReturnReason" provider="simpleCode" cssClass="required"> <s:param name="type">210</s:param> </caf:checkboxlist> </td> </tr> <tr id="ReturnrReasonNote" style="display: none"> <td>附件退回原因備注</td> <td colspan="3" > <textarea cols="90" id="ReturnRemarks" rows="2" name="workFlowParam.annexReturnreasonRemarks">${apprSugg.annexReturnreasonRemarks}</textarea> </td> </tr>