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