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

161
Vistas
Prompt for a name and make a table in DOM with JavaScript

How to prompt for a name and then pass the name to a function that will find the given name from the given array with subarrays. I should use the found array element to print out the name in the DOM, the voting status, and the given grade as a table.

For example: [[Jack, true, 10],[John, false],[Rachel, true, 7]]. When user input in prompt is Jack, than in DOM should be printed out: JACK, VOTED, 10 as a table.

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

0

Something like

var name = document.getElementById('myInput').value;
for (i=0; i<array.length-1; i++){
    if (array[i][0] == name) {
        document.getElementById('myDOM').innerHTML = array[i][0] + ',' + array[i][1] + ',' + array[i][2];
    };
}

For 'myInput' and 'myDOM' you will want to fill in the IDs of the elements that you are taking the input from and choosing to output to.

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