Вы можете изменить виджет, не обновляя его, если вы измените только правильные элементы.
$('#button').click(function () {
//1. change the `data-icon` attribute of the link element
//2. then find the `.ui-icon` element and remove the "delete" icon class, then add the "check" icon class
//3. then traverse to the `.ui-btn-text` element (a sibling of the `.ui-icon` element) and change the text of the element there
$(this).attr('data-icon', 'check').find('.ui-icon').removeClass('ui-icon-delete').addClass('ui-icon-check').prev().text('New Text!');
});
Это приведет к кнопке с другим значком и текстом.
Здесьэто демо: http://jsfiddle.net/jasper/Pd6au/1/
Вот ваш код после его инициализации jQuery Mobile (это просто кнопка «Удалить»):
<a data-icon="delete" id="button" class="ui-btn-left ui-btn ui-btn-icon-left ui-btn-corner-all ui-shadow ui-btn-up-a" data-theme="a">
<span class="ui-btn-inner ui-btn-corner-all">
<span class="ui-btn-text">Delete</span>
<span class="ui-icon ui-icon-delete ui-icon-shadow"></span>
</span>
</a>
Когда вы делаете что-то вроде: $('#button').text('new text')
, вы переписываете всю HTML-структуру виджета, поэтому важно изменить целевой элемент .ui-btn-text
при изменении текста кнопки.