I used the solution to this question in my project to change the icon of a button when the user clicks on it:
$('#buttonSwitch').buttonMarkup({icon: "minus"});
However, not only the icon but also the shape of the button changes (the rounded corners):
Before the click: 
After the click: 
You can find a minimal example here: -removed-
I would like to know how I can just change the icon without changing the shape of the button.
Thanks in advance for your help.
Edit: There is still one little problem. After the click, the button has this small white border on the bottom:

It’s because you have custom CSS (border-radius) on your button. And the buttonMarkup function sets the border-radius to default. So, you have to store the current border-radius, change the button, and restore the border-radius.
Modify your JS function to: