js控制表单页面分页显示并使点击切换页面的标题变色显示

<script type="text/javascript" language="javascript">
   function selType(val){
  if(val=="jisuan"){
  table1.style.display="block";
  table2.style.display="none";
  yanse1.style.background="red";
  yanse.style.background="#498cd0";
  }else if(val=="area"){
  table1.style.display="none";
  table2.style.display="block";
  yanse.style.background="red";
  yanse1.style.background="#498cd0";
  }
   }
</script>
<input type="button" id="yanse" name="sel"style="cursor:pointer;margin:10px;background-color: #498cd0;border: 0px;color: white;width: 100px;" value="2014年信息"  οnclick="selType('area')" />
<input type="button" id="yanse1" name="sel" style="cursor:pointer;margin:10px;background-color: red;border: 0px;color: white;width: 100px;" value="2015年信息"  οnclick="selType('jisuan')" />

<table id="table1" style="display:block">
<tr>
<td>输入信息</td><td><input type="text"  /><input type="button" name="sel" value="下一页" οnclick="selType('area')" /></td>
</tr>
</table>
<table id="table2" style="display:none">
<tr>
<td>输入第二个信息</td><td><input type="text"  /><input type="button" name="sel" value="上一页"  οnclick="selType('jisuan')" /><input type="button" name="sel" value="下一页" οnclick="selType('abc')" /></td>

</tr>
</table>
总结:平时做项目会遇到比较大的表单,要进行分页,以上的方法非常的实用。我一般写的博客都是自己使用过后觉得好用实用我才发表出来

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值