Create an XPage.
Drag and Drop a button Control on to it and give the button a name and a label
Now on the events tab of the button, in the onclick event, select client side and type in the following code
var currId = thisEvent.target.id;
Now and preview your XPage and click the button.
The result would be an alert box with the id of the button control that you have mentioned in the XPage. Again it will not be exactly the same but will be along with a pattern generated by the XPage and the same will be consistent.