IE does not fire up on change event

Viewed 3315

I have problem with firing up on change event in IE. All what I have tried is working In other browsers like Chrome, Mozilla, Safari, Opera... but not in IE 11

Here is my code

html

<form method="post" id="exchangeType" action="/orders/vesselExchange">
...
<label id="deliveryDateTitleLabel" for="deliveryDate"><?= __('First time') ?></label><br/>
                <label class="radio radio-inline m-r-20">
                  <input type="radio" name="deliveryDate" value="asap" checked>
                  <i class="input-helper"></i>
                  <?= __('First time') ?>
                </label>

                <label class="radio radio-inline m-r-20">
                  <input type="radio" name="deliveryDate" value="custom">
                  <i class="input-helper"></i>
                  <?= __('Second time') ?>
                </label>
...
</form>

jQuery

$('#exchangeType input').on('change', function() {
  console.log('in function');
  let option = ($('input[name=deliveryDate]:checked', '#exchangeType').val());
  let dateTimePicker = $('#showPicker');

  if (option === 'custom') {
    dateTimePicker.removeClass('hidden');
  }

  if (option === 'asap') {
    dateTimePicker.addClass('hidden');
  }
});

What I have tried until now

$(document).on('change','#exchangeType input' ,function(){
...
}

$(document.body).on('change','#exchangeType input' ,function(){
...
}

$('#exchangeType').on('change','input[name=deliveryDate]',function(){
...
}

same functions with 'click' (not change)

I have read and implement some answers of similair questions on stackoverflow:
- Jquery select change not firing
- .val() doesn't trigger .change() in jquery
- OnChange not firing in IE

But it doesnt work...

Thank you

2 Answers
Related