联系我们

为客户提供超预期的高品质网站设计!

jquery 模拟单选

2017-11-27 0:00:00

 <div>

    <span class="chePaiFlag  onIt">普通车牌</span>

    <span class="chePaiFlag">新能源车牌</span>

</div>


$(function () {
           
            $(".chePaiFlag").each(function () {
                var p=$(this);
                p.click(function () {
                   
                   

                    if ($(this).hasClass("onIt"))
                    {
                      
                    }else{
                        $(".chePaiFlag").each(function () {
                            $(this).removeClass("onIt");
                        });
                        $(this).addClass("onIt");
                      
                    }
                    flagPai = p.text();
                    if (flagPai == "新能源车牌") {
                        $(".k8").show();

                    }
                    else {
                        $(".k8").hide();
                    }

                })
            })
        })



上一条新闻:于Repeater中的Button按钮中的CommandArgument传参 当有多个参数
下一条新闻:asp.Net中 Replace函数的用法

 

400-6137-308 54057491 info@maolian.net