Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

158
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!