-1

I am working on some kind of script. It needs to remain on the same tab when performing click event but clicked link should open in new tab. I can use Ctrl + Click but how to press CTRL programatically ?

e.g.

<a id="stack" href="http://stackoverflow.com">Click Here</a>

The question is how do I do that in Javascript or jquery?

0

JavaScript key code for Ctrl is 17 you can check here for Javascript Key Codes

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.