I want to create a web app like google sheets in jQuery, but when I try to get a <select>
value with $(select).val()
I get `null.
I tried to put the code into $(button).click()
and then it worked so I think the problem is that Javascript is executed before HTML, but I am not sure.
$(function() {
$.post("getTablesName.php", function(data) {
$("#tables_SCT").html(data);
});
var name = $("#tables_SCT").val();
$.get("getTable.php", { name: name }, function(data) {
$("#columns").html(data);
});
)};
I just want to get the $("#tables_SCT").val()
.