automatically select link when clicking on popup