js常用功能代码(持续更新):
1,--折叠与展开
<input id="btnDisplay" type="button" class="baocun2" value="添加" onclick="changeDisplay()" /> <script type="text/javascript"> function changeDisplay() { var helloDivObj = $("#addressdiv"); var buttonObj = $("#btnDisplay"); var val = buttonObj.attr("value"); if (val == "隐藏") { helloDivObj.hide(); buttonObj.attr("value", "添加"); } else { helloDivObj.show(); buttonObj.attr("value", "隐藏"); } } </script>
时间: 2024-12-24 03:28:16