Although this does not address the problem directly, it can be a viable solution until a more suitable solution appears.
Write one function that will be called onClick, and let the function be smart enough to know who named it. The function then performs the appropriate actions based on who pressed it. You can send it almost everything that would be unique, and then use the switch.
simplified example:
<html> <body> <script type="text/javascript"> function myClickHandle(anID) { switch(anID){ case 'bottom': alert("I am on the bottom"); break; case 'top': alert("I am on the top"); break; } } </script> <html> <div style="z-index:10"><input type=button value='top' onclick="myClickHandle(this.value)"/></div> <div style="z-index:11"><input type=button value='bottom' onclick="myClickHandle(this.value)"/></div> </body> </html>
Cranium slows
source share