Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

127
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda