let tableSelectionDomElement = document.getElementById("tabla"); let selectedTable = "tagok"; tableSelectionDomElement.addEventListener("change", function (){ selectedTable = tableSelectionDomElement.value; console.log(selectedTable); });