JQuery event handler when select element is loaded

前端 未结 7 1725
清歌不尽
清歌不尽 2021-01-03 01:53

Is there an event handler to use in JQuery when a DOM select element has finished loading? This is what I want to achieve. It is working with other events e

7条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-03 02:31

    Do you want all Selects to be checked when the User-Select is loaded, or just the User-Select?...

    $.post("./user_functions.php", {reason: "get_users", userID: uID}).done(function(data) {  
        $("#userSelector").html(data);
        //Then this:
        var currentSelectVal = $("#userSelector").val();
        alert(currentSelectVal);
    });
    

提交回复
热议问题