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

96
Views
¿Cómo agrego una casilla de verificación en la misma línea que mi párrafo?

Estoy tratando de agregar una casilla de verificación en la misma línea que mi párrafo en mi lista de tareas pendientes.

Yo he tratado:

 let addToDoButtton = document.getElementById('addToDo'); let toDoContainer = document.getElementById('toDoContainer'); let inputField = document.getElementById('inputField'); addToDoButtton.addEventListener('click', function(){ var paragraph = document.createElement('p'); var checkbox = document.createElement('input'); checkbox.type='checkbox'; paragraph.classList.add('paragraph-styling'); paragraph.innerText = inputField.value; toDoContainer.appendChild(checkbox); toDoContainer.appendChild(paragraph); inputField.value="" paragraph.addEventListener('click', function () { paragraph.style.textDecoration="line-through"; paragraph.style.color='#5493f7'; }) paragraph.addEventListener('dblclick', function(){ toDoContainer.removeChild(paragraph); toDoContainer.removeChild(paragraph) })

También he probado:

 toDoContainer.appendChild(checkbox) && toDoContainer.appendChild(paragraph);

Tengo esto para la salida:

producción

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

Por favor, eche un vistazo aquí

 const input = document.createElement('input'); input.id = 'input'; input.type = 'checkbox'; const label = document.createElement('label'); label.htmlFor = 'input'; toDoContainer.append(input, label);
about 4 years ago · Santiago Gelvez 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!