How to change the buttons text using javascript

后端 未结 5 1350
孤街浪徒
孤街浪徒 2021-01-30 10:10

I have the following code to set the text of the button through javascript code , but it does not work it remains same the text remains same.

function showFilter         


        
5条回答
  •  轮回少年
    2021-01-30 10:49

    Another solution could be using jquery button selector inside the if else statement $("#buttonId").text("your text");

    function showFilterItem() {
    if (filterstatus == 0) {
        filterstatus = 1;
        $find('<%=FileAdminRadGrid.ClientID %>').get_masterTableView().showFilterItem();
        $("#ShowButton").text("Hide Filter");
    }
    else {
        filterstatus = 0;
        $find('<%=FileAdminRadGrid.ClientID %>').get_masterTableView().hideFilterItem();
         $("#ShowButton").text("Show Filter");
    }}
    

提交回复
热议问题