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

141
Views
How do I get the answers on the table using vanilla JS?

I am trying to get the answers in the table and am unsure how to do so using only Javascript. No JQuery https://jsfiddle.net/4yxz39gk/

const grid=document.querySelector(".grid")
const smallgrid=document.querySelector(".grid-small")
let num = []
let times= []

function arr(){
    for (let i=0; i<169; i++){
       let small=document.createElement("div")
       grid.appendChild(small)
       num.push(small)
       
        num[i].classList.add("grid-small")
      
      
      
    }
       
     
    
}

arr()


function time(){
    for(let i=1; i<13; i++){
        for(let j=1; j<13; j++){
            let result = i*j
            times.push(result)
            
        }
    }
}
time()
console.log(times)

How do I add my answers to my table! Any help is much appreciated.

Thanks

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I don't know if this is exactly what you want.

function time(){
    let index = 0;
    for(let i=1; i<=13; i++){
        for(let j=1; j<=13; j++){
            index++;
            let result = i*j
            times.push(result)
            document.querySelector(`.grid > div:nth-child(${index})`).textContent = result
        }
    }
}
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!