To capture clicks in objects in the scenes, you can use the API described here (take a look also at the sample body-end.html
file linked from that section(.
In case of the anchors, it is only possible to capture clicks on anchors that your JavaScrtipt code added. Take a look at this example. It is not possible to capture clicks on anchors added from the editor.