码迷,mamicode.com
首页 > Web开发 > 详细

jquery 点击切换值

时间:2017-08-22 17:34:39      阅读:203      评论:0      收藏:0      [点我收藏+]

标签:class   lin   title   toggle   ogg   set   java   color   nbsp   

<!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;
                width: 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("我要显示出来!");
        $(this).val("33333");
      },
      function(){
        $(".show_div").html("我隐藏!");
     $(this).val("5555");
      });
    });
</script>
    </body>
  
</html>

jquery 点击切换值

标签:class   lin   title   toggle   ogg   set   java   color   nbsp   

原文地址:http://www.cnblogs.com/gerry/p/7412546.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!