function will be called.in this function we get the id this way -
function Mitsol_CommentAdd(caller) { 
 var id = caller.id; // id will store the id
 var newid = id.split("_"); 
 if (newid[2] == "submit") { } //do task
}
in page - asp.net control look like below -
<asp:Button ID='Mitsol_Submit_Button' OnClientClick="Mitsol_CommentAdd(this); return false;" 
CssClass="button bigrounded blue" runat="server" resourcekey="Submit Comment"/>
for html element you will use click instead OnClientClick.

 logging in