Fix bug #3502 (clicking some links in Quick Docs doesn't work)

Fix bug #3502 -- don't use `event.target` since that might point to a child of the link tag, e.g. in this case a `<b>`.

Also fix same bug in the other places we have similar logic, although so far they haven't hit this problem.