Now also works for links where a nested element, such as a span, has an onclick handler.