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

147
Views
Obtener valor/texto de la lista de selección/desplegable

He buscado mucho en la web, pero por alguna razón, mi código = No funciona;

Mi JavaScript:

 let a = document.getElementById("a"); let b = document.getElementById("b"); let c = document.getElementById("c"); let button = document.getElementById("button"); button.onclick = function() { var info = {"a": a.value, "b": b.value, "c": c.value}; console.log(info.a + info.b + info.c); }

Todo excepto el C One funciona, que es un menú desplegable (A y B son cuadros de texto).

HTML:

 <button type = "button" id = "button">Button</button> <input type = "text" id = "a"> <br><br> <input type = "text" id = "b"> <br><br> <select name = "c" class = "c"> <option value = "c1" class = "c" selected>c1</option> <option value = "c2" class = "c">c2</option> <option value = "c3" class = "c">c3</option>
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!