How can I do something that after the DOM has been loaded after an AJAX call?

advertisements
<div id="mydiv">
    ...
    <a id="my-ajax-link"> ... </a>

    ...
    ...

    <select id="my-selectmenu">
        ...
    </select>
    ...
</div>

I have a link 'my-ajax-link' clicking upon which an AJAX call is fired, which updates the content of div 'mydiv'.

I want to do something with the select menu through jQuery only after the DOM in the div 'mydiv' has loaded completely after the AJAX call.

How can I achieve this?


Just use ajax calback:

$.ajax({
...
}).always(function(response_data) {
  alert('ajax finished');
});