常用的特殊功能用js实现

来源:互联网 发布:淘宝基础题 编辑:程序博客网 时间:2024/05/22 00:52

一、页面5秒后跳转:      

        <!--js--> 

        <script>
           function init(){
                  window.setTimeout("tiao()",3000);
           }
           function tiao(){
                  window.location.href="<%=basePath%>login.do";
           }
        </script>

        <!--jsp-->

        ......

       <body onload="init();">

       ......

二、内容的监听:即"您还可以输入25个字...":

  <textarea name="" id="tsendm" onkeyup="change_tsendm(this)"  class="fabu_area"></textarea>

  <script>

        function change_tsendm(obj){
              document.getElementById("szxz").innerHTML=140-obj.value.length;
        }

       </script>

原创粉丝点击