You're writing wrong code, write this
$('button').click(function () {
$('h3 span').text('Mobile');
});
This means that in the beginning, you're going to remove any text from the h3.
<h3>
<span></span>
<img src="/Images/edit.png" alt="Edit" align="middle" class="attEditCategory" />
<img src="/Images/delete.png" alt="Delete" align="middle" class="attDeleteCategory" /></h3>
You need to have a span element atleast in the h3 element just to ensure that upon the code execution the images don't get removed when you add text to it.