• 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>

  • 相关阅读:
    convex hull
    不努力,你就没有资格谈天赋
    “数数”的感悟
    平行四边形法则的感悟
    ansys 15 Linux 安装问题
    SHV-E210S 刷4.3
    fedora 安装 Oracle11g 遇到的问题
    ObjectArx开发常用资料
    MFC入门(二)
    MFC入门(三)
  • 原文地址:https://www.cnblogs.com/gerry/p/7412546.html
Copyright © 2020-2023  润新知