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

143
Vistas
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 Respuestas
Responde la pregunta

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 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