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

195
Vistas
How do I make a form using parsed JSON data?

(I haven't decided what exactly the questions and options are going to be yet). You can see below the parse object I've tried to build the quiz using form. When I try to run this code nothing shows up. What am I doing wrong? I really, really appreciate any help.

const json = 
  { quiz: 
    { q1: { question: 'The question?', options: [ 'option one', 'option two'] , answer: 'The answer' } 
    , q2: { question: 'The question?', options: [ 'option one', 'option two'] , answer: 'The answer' } 
    , q3: { question: 'The question?', options: [ 'option one', 'option two'] , answer: 'The answer' } 
    , q4: { question: 'The question?', options: [ 'option one', 'option two'] , answer: 'The answer' } 
  } } 
  
var obj = JSON.parse(JSON.stringify(json));
console.log(obj);

for (let i = 0; i < obj.quiz.length; i++) {
  document.body.innerHTML +=
    '<h2>' + obj.quiz[i].question + '</h2>'
  document.body.innerHTML +=
    '<form>' + '<input type="radio" name="options" value="option">' + '<label for="option">' + obj.quiz[i].options + '</label>' + '<br>' + '</form>'
}

about 4 years ago · Juan Pablo Isaza
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