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

126
Views
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
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!