The question is similar to the one here, except I need to use Javascript. I have a button like so:
<button id="btn1" onclick="clickhandler()">Test</button>
I need this for verification purposes, i.e. to assign the click handler, and then use javascript to verify that the correct function was assigned.