How to change the buttons text using javascript

后端 未结 5 1304
孤街浪徒
孤街浪徒 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:38

    You can toggle filterstatus value like this

    filterstatus ^= 1;
    

    So your function looks like

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

提交回复
热议问题