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>