Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

166
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda