$(this).text()==="Show introduction" displays no instead of yes
图图
图图 2017-12-02 00:29:23
0
2
1480

<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>

        <script>

        $(function(){

            $("#btn").click(function(ev){

                if ($(this).text()==="显示简介") {

                    alert('yes');

                }else {

                    alert('no');

                }

            });

        })

        </script>

        </head>

    <body>

        <button id="btn">

            显示简介

        </button>

        <div id="ppt" style="display: none;">11111</div>

    </body>


图图
图图

reply all(1)
路过
  1. Can there be branches inside the button?

  2. There is a big difference between "===" and "=="

  • reply Yeah, it’s true that buttons can’t be branched.
    图图 author 2017-12-02 21:18:25
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template