Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

66
Visualizações
select tag not working when rendering from js

I've used below code to get select value, but when I select any option, I'm getting correct value in console but in the UI select option is not changing.

script.js

    html += '<thead><tr>';
    html += '<td colspan="4">';
    html += '<select id="selectedMonth" onchange="getMonthAndYear()">';
    for (var i = 0; i < this.Months.length; i++) {
        html += '<option value="' + this.Months[i] + '">' + this.Months[i] + '</option>';
    }
    html += '</select>';
    html += '</td>';

**********************************************************************

function getMonthAndYear() {
    var selectedMonth = document.getElementById('selectedMonth').value;
    console.log("I'm getting this value correctly: " + selectedMonth);
}

Please this GIF - https://i.ibb.co/5jGDyBn/gif-20220105-214557.gif

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda