Well - if you used the simple version of onclick event, that is, the declaration in the element, then you'd have no problem (you'd give each function a different name).
<button onclick="doThis()"><button>
<button onclick="doThat()"><button>
Of course, the above is "real" javaScript.
Alternatively, you could have a single function and send in an object argument (by which I mean something like an id value) which you handle in a switch. One function, many outcdomes (and poor but successful coding).