@r035198x
Doesn't account for AutoPostback. I'm in agreement with Frinny's suggestion:
Write a function that updates a hidden field and add handlers to the OnFocus and OnBlur events to call that function attaching the id of the currently focused object. If you want to know the
last focussed object rather than the
currently focussed object, then omit the OnBlur event handler.
In the postback check the value of the hidden field.