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

263
Views
I Want to Grab the Event Values... What can I use instead of Event.srcElement?

I Want to Grab the Event Values. What can I use instead of Event.srcElement?

//Take Values from our Form Input
function updateCountdown(e){
    e.preventDefault()
    countdownTitle = e.srcElement[0].value
    countdownDate = e.srcElement[1].value
    console.log(countdownTitle, countdownDate)
}
about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

If you want to grab the value of event, you can do event.target.value or e.target.value in your case. According to MDN it is the best approach.

But if you want to grab the values from inputs on submitting the form you should use method elements : form.elements["name of an input"].value

I've created simple form to demonstrate this in action: CodeSandbox

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!