How to register an onclick event listener.