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

172
Views
¿Cómo hago que un console.log() imprima el valor seleccionado en una entrada de rango?
input.addEventListener('click', () => { let input = document.getElementById('myRange').value console.log(input.value) if (input === '1'){ theme1() } if (input === '2'){ theme2() } })

El console.log(input.value) muestra undefined . Quiero que me muestre el valor seleccionado en la entrada cada vez que hago clic en él.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

En su código, está configurando la input al valor y luego tratando de hacer .value , por lo que esencialmente está haciendo input.value.value

Cambiando su código a

 input.addEventListener('click', () => { const value = document.getElementById('myRange').value console.log(value) if (value === '1'){ theme1() } if (value === '2'){ theme2() } })

lo resolvere

about 4 years ago · Juan Pablo Isaza 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!