Execute jquery function if Ajax callback form complete I got a custom ajax callback which replaces my checkbox options based on the select option.

Now after the checkboxlist get's updated i need to execute a jquery function on those checkboxes. 

How can i execute this custom jquery function after the callback is done, so after the checkboxlist is updated.

Form element:

        $widget['select_box'] = array(
            '#type' =&gt; 'select',
            '#title' =&gt; 'Select bussen',
            '#options'  =&gt; $options,
            '#validated' =&gt; TRUE,
            '#default_value' =&gt; '_none',
            '#attributes' =&gt; array('class' =&gt; array('select-province')),
            //The callback
            '#ajax' =&gt; array(
              'callback' =&gt; 'ajax_select_callback',
              // 'wrapper' is the HTML id of the page element that will be replaced.
              'wrapper' =&gt; 'replace_select_div',
            ),
        );

        //Form element wich get updated
        $widget['select_box_2'] = array(
            '#type' =&gt; 'checkboxes',
            '#title' =&gt; 'Select bussen',
            '#options' =&gt; ...,
            '#prefix' =&gt; '&lt;div id="replace_select_div"&gt;',
            '#suffix' =&gt; '&lt;/div&gt;',
            );


Ajax callback function:

    function ajax_select_callback($form, $form_state) {
      // The form has already been submitted and updated. We can return the replaced
      // item as it is.
    return $form['line_item_fields']['field_bussen_select']['und'][0]['select_box_2']

    }


Jquery function i run on the checkboxes:

    jQuery("input[type='checkbox']").change(function () {
        jQuery(this).parent().siblings('ul')
            .find("input[type='checkbox']")
            .prop('checked', this.checked);
    });
I think if found the answer at :https://drupal.org/node/171213.

Section: JavaScript on your AJAX form

"Attach jQuery to Drupal.behaviors, that way it can be run anytime new DOM elements are inserted. One example, if you're using AJAX in Views, each time a section of the page reloads, it will reload/run jQuery."

Didn't test it, because i don't need it anymore :), but still good to know!