I want to open multiple links using a hotkey on a web page. For this I am using accesskey
for hotkey mapping and the following code.
<a href="https://link1"
onclick="window.open('link2'); window.open('link3'); return true;"
accesskey="1">Some text</a>
The onclick
event will not acknowledge when the element is accessed using accesskey
(but tab to select and enter works). Is there another DOM event, or method which can accomplish the function of hotkey = 'open_multiple_windows'?
I have tried to use onsubmit
, onchange
, oninput
, onselect
and onopen
.
To do this, you'll need to hold down the right mouse button, then draw a box around the links you want opened. A tiny number appears on the bottom right corner of the selection box to indicate how many links will be opened. As soon as you release the mouse button, all selected links will open at the same time.
Or, use a keyboard shortcut: Windows & Linux: Ctrl + t. Mac: ⌘ + t.
<a href="#" onclick="window.open('https://google.com','_blank'); window.open('https://bing.com','_blank');" accesskey=1></a>
This code should work BUT multiple pages could be blocked (as a popup)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With