Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

93
Vistas
JS open muliple PDFS at once

I have a multiple select dropdown list.

<select name="YRsummaries" id="YRcollection" multiple>
<option value="">Please Select a Year</option>
<option value="/PDF/MCR0621.pdf"><a title="Fiscal Year 2021 &ndash; 2022">F.Y. 21</a></option>
<option value="/PDF/MCR0620.pdf"><a title=" Fiscal Year 2020 &ndash; 2021">F.Y. 20</a></option>
<option value="/PDF/MCR0619.pdf"><a title="Fiscal Year 2019 &ndash; 2020">F.Y. 19</a></option>
</select>
<button type="button" id="yrcollections" onclick="yrCall()"> Get Documents</button>

I am pushing all selected values to a js array. I have console logged the value and multiple comes but when it goes to execute the window.open it only does the first one.

here is the js code

function yrCall(){
const selected = document.querySelectorAll('#YRcollection option:checked');
const valuey = Array.from(selected).map(el => el.value);
for(var i = 0; valuey.length > i; i++){
var url = valuey[i];
console.log(url);
window.open(url, '_blank');
}}

any help would be appreciated.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Hi I think there is a browser default setting for opening multiple tabs in your browser. I tried your code and this popup shows.

enter image description here

After choose always allow pop-ups, all three tabs showed without any problem.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda