zoukankan      html  css  js  c++  java
  • jquery 点击切换值

    <!DOCTYPE html>
    <html>

        <head>
            <meta charset="UTF-8">
            <title></title>
            <script src="jquery-1.8.3.min.js"></script>
            <style>
                .show_div {
                    background: red;
                    color: #fff;
                    200px;
                    height: 200px;
                    line-height: 200px;
                    text-align: center;
                }
                .show_div1 {
                    background: blue;
                    color: #fff;
                    200px;
                    height: 200px;
                    line-height: 200px;
                    text-align: center;
                }
            </style>
        </head>

        <body>
            <div class="show_div">我要点击</div>
            <input type="button" id="inp"  value="33333" />
       
    <script type="text/javascript">
      $(function () {

          $("#inp").toggle(
          function(){
            $(".show_div").html("我要显示出来!");
            $(".show_div").addClass("show_div1");
           
            $(this).val("33333");
            
            
          },
          function(){
            $(".show_div").html("我隐藏!");
           $(".show_div").removeClass("show_div1");
             $(".show_div").addClass("show_div");
         $(this).val("5555");
          });
        });
    </script>
        </body>
     
    </html>

  • 相关阅读:
    @XmlAccessorType @XmlType 详解
    eclipse properties 文件查看和编辑插件 Properties Editor
    对象设计解耦的方法IOC和DI
    J2EE7与Servlet3.x
    关于maven
    Spring版本功能变更&Spring4.x的新特性
    2017第37周三
    Java线程池
    Java并发包
    Java内部类
  • 原文地址:https://www.cnblogs.com/gerry/p/7412546.html
Copyright © 2011-2022 走看看