Check if a multi select dropdown list was changed

Check if a multi select dropdown list was changed

Hi,
I need to check if the values of a multi select dropdown list as been changed from there initial values.

The following code works when it's a single select dropdown list:

  1. if ($input.is('select')) {
  2.       changed = !$('option:selected', $input).prop('defaultSelected');
  3. }
In a multi select dropdown list if I have this initial values: option a and b then add option c, it does not change the state of 'changed' var, only if I remove both option a and b.

Grateful for any help.