![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
1 function changeDisplay() { 2 if ($("#btnShow").attr("value")== "添加附件") { 3 $("#IdShow").show(); 4 $("#btnShow").attr("value", "取消添加附件"); 5 } 6 else { 7 $("#IdShow").hide(); 8 $("#btnShow").attr("value", "添加附件"); 9 } 10 }
页面代码
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
1 <input type="button" id="btnShow" name="btnShow" value="添加附件" onclick="changeDisplay()" />
idShow为div的id