zoukankan      html  css  js  c++  java
  • 文本框内容提示效果

    文本内容提示效果,未输入内容时显示文本内容,点击输入时内容后消失,由于是IE8,所以无法利用placeholder实现效果:<input  placeholder="提示语"/>,利用js实现该效果

    //给出提示:原因+出行人员
             var tit=document.getElementById("whir$t3371_f7764").value;
             if(tit==""){
                 document.getElementById("whir$t3371_f7764").innerText="事由+出行人员";
             }
             var tis=document.getElementById("whir$t3371_f7764");
             tis.onfocus=function(){
            if(this.value=='事由+出行人员'){
              this.value='';
              
            };
          };
           tis.onblur=function(){
            if(!this.value){
              this.value = '事由+出行人员';
            };
          };

    <input id="whir$t3371_f7764" value="事由+出行人员">

  • 相关阅读:
    Java 代理模式
    ReentrantLock 详解
    Java线程池详解
    ConcurrentHashMap 解读
    CountDownLatch/CyclicBarrie用法记录
    微信接入笔记记录
    iOS设计模式
    iOS设计模式
    iOS设计模式
    iOS设计模式
  • 原文地址:https://www.cnblogs.com/cjxns/p/9447940.html
Copyright © 2011-2022 走看看