jQuery的更改按钮上的文字点击 [英] jquery change button text on click

查看:75
本文介绍了jQuery的更改按钮上的文字点击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须更改单击按钮上的按钮文本,或者使用aspx页面上的jquery来更改按钮文本.我为此使用了以下代码.但是其他部分不起作用.
请帮忙.


I have to change the button text on its click alternatively using jquery on aspx page. I have used the below code for this. But the else part doesn''t work.
Please help.


$(function () {
                $("#<%=btnSearch.ClientID %>").click(function () {
                    $("#dv").slideToggle(500);
                    if ($(this).text("Hide Selection Criteria")) {
                        $(this).html('Show Selection Criteria');
                        //alert("aaaa");
                    }
                    else {
                        if ($(this).val() = "Show Selection Criteria") {
                            $(this).html('Hide Selection Criteria');
                            alert("bbbb");
                        }
                    }
                    return false;
                });
            });

推荐答案

(function(){
(function () {


(" ).click(function(){
("#<%=btnSearch.ClientID %>").click(function () {


(" ).slideToggle( 500 ); 如果(
("#dv").slideToggle(500); if (


这篇关于jQuery的更改按钮上的文字点击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆