zoukankan      html  css  js  c++  java
  • jquery获取焦点和失去焦点

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    <script src='../jquery.js'></script>
    <style>
        .hide{display:none}
        .test{background:green}
    </style>
    </head>
    <body>
            <div id='test'>ttttt</div>
            <input type='text' id='adress' value='请输入' />
        <script>
        $(function(){
            $('#adress').focus(function(){
                var text=$(this).val();
                if(text=='请输入'){
                    $(this).val('');
                }
            });
            $('#adress').blur(function(){
                var text=$(this).val();
                if(text==''){
                    $(this).val('请输入');
                }
            });
        });
        </script>
        
    </body>
    </html>

  • 相关阅读:
    Struts22222
    Struts2
    Java事务的概念
    Java设计模式之单例模式
    Spring的大框架
    mybatis大框架
    springmvc和spring的区别
    JavaScript-原型&原型链&原型继承&组合函数
    美丽的CSS图形和HTML5
    易买网项目的总实现超级详解
  • 原文地址:https://www.cnblogs.com/huifeideyu/p/jquery.html
Copyright © 2011-2022 走看看