zoukankan      html  css  js  c++  java
  • val() 方法

    node2:/var/www/html/js#cat h7.html 
    <input type="text" id="address" value="请输入邮箱地址"/>
    <input type="text" id="password" value="请输入邮箱密码"/>
    <input type="button" value="登录"/>
    <script type="text/javascript" src="jquery-2.2.2.min.js"></script>    
    <script type="text/javascript" src="h7.js"></script>
    node2:/var/www/html/js#
    node2:/var/www/html/js#cat h7.js
    $("#address").focus(function(){
       var txt_value = $(this).val() ;// 获取地址文本框的值
       console.log('aaaaaaaaaaaaaaaaa');
       console.log(txt_value);
       console.log('aaaaaaaaaaaaaaaaa');
       if (txt_value == "请输入邮箱地址"){
         $(this).val("");
        }
    });
    
    
    $("#address").blur(function(){
       var txt_value = $(this).val() ;// 获取地址文本框的值
       console.log('aaaaaaaaaaaaaaaaa');
       console.log(txt_value);
       console.log('aaaaaaaaaaaaaaaaa');
       if (txt_value == ""){
         $(this).val("请输入邮箱地址");
        }
    });

  • 相关阅读:
    Angular
    Angular
    Angular
    Angular
    Angular
    Angular
    Angular
    springsecurity 源码解读 之 RememberMeAuthenticationFilter
    springsecurity 源码解读之 AnonymousAuthenticationFilter
    springsecurity 源码解读之 SecurityContext
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13348886.html
Copyright © 2011-2022 走看看