When I use embedded javascript functions I can get client id of elements with this code:
document.getElementById(\'<%=buttonXXX
I know old question but with jquery u can use this approache:
Aspx file
external js file
$("[ClientID='btnCalculate']").
https://lanitdev.wordpress.com/2009/06/08/extending-jquery-to-select-asp-controls/