I assume there was a typo in your code and you didn’t want to close the span span tag, so your code
<button type="button" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" role="button" aria-disabled="true"> <span class="ui-button-text">Save</span> </button>
Then you can change the word “Save” in the next line to any text in the button that you want to hide.
$("button span:contains('Save')").parent().attr("disabled", true);
source share