Is it possible to suppress the default IE 7 functionality when CTRL+click on link opens a new window? if so, how?
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There is no way to suppress a Ctrl + Click on a link with no child elements in Internet Explorer — the
onclickevent doesn’t fire at all for link clicks if the Ctrl key is held down. It seems that Microsoft don’t want you to change this functionality out of fear that you might confuse the user.I searched for some sort of official confirmation/explanation before posting this answer, but unfortunately this limitation is not listed in the documentation on MSDN and Google wasn’t helpful. Nevertheless, it remains true, try it yourself:
You will find that a Ctrl + click on the link will not throw the alert box. According to pinkgothic, assigning a child element to the link will work around the problem. For example:
This works because the click is triggered for the
<span>element first, before propagating to the<a>element.