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

131
Vistas
Value not being captured and updated from user input

Im trying to make it so when the user double clicks an html element it turns into an input field.

At this point I want to capture and update the field to be what the user entered. My current code is producing an empty output. Im thinking its my last line of code causing the issue.

dktcell_1.addEventListener('dblclick', function () { //add double click event to cell 1 docket# with anonymous function
  dktcell_1.innerHTML = "<input id=samcel type=text>" // change html element to input field

  dktcell_1.addEventListener('keypress', function (e) {//nested keydown event added with e paremeter to access event object properties
    if (e.code === 'Enter') { //check if the user presses "enter"
      dktcell_1.innerHTML = dktcell_1.textContent; //capture value entered and update html element
    }
  })
})
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