I have a requirement to click on multiple links (selecting them) and then click a button that will open all selected links in new windows or tabs. This will of course be dependent upon the browser behaviour.
My plan is to use Javascript to add the selected links to an array and then upon clicking the submit button, the javascript will run through the array and open a new window for each item. I will probably do this in jQuery.
Has anyone done anything similar? Are there alternatives?
I think you are right.
The best way to achieve what you are describing IMHO is to place URL’s of links you want to open in new windows into an array, using
return false;in order to prevent actually opening link and then to use some sort of loop to open all of them.I took a liberty of putting together few lines of jQuery code that will do what you have described:
HTML would look something like: