Conditional views exposed filters (using Search api views) I have two views exposed filters,one dropdown field and a checkbox.
I want,when the checkbox is checked the dropdown field to dissappear.When I uncheck the checkbox I want the dropdown field to appear again.

First I tried Views dependent filter,however it doesn't play well with Search api views.

Secondly I tried with javascript.I wrote this code and added it to the .js file of my theme.However it doesn't also work.How can I do this?

(function ($) {
  Drupal.behaviors.cdgi = {
    attach: function(context) {

      var $('#edit-field-level-of-telecommuting-1').prop('checked') = true;
      if ($('#edit-field-level-of-telecommuting-1').prop('checked') === true) {
        $('#edit-field-job-region-parents-all').hide();
      } else {
        $('#edit-field-job-region-parents-all').show();
      }
    }
  }
}(jQuery));`
There is a slight change in the code.May be this can help you.

(function ($) {
  Drupal.behaviors.cdgi = {
    attach: function(context) {
     $(function () {
      $('#edit-field-level-of-telecommuting-1').click(function() {
        if ($(this).prop("checked")) {
          $('#edit-field-job-region-parents-all').hide();
        } else {
          $('#edit-field-job-region-parents-all').show();
        }
      });
     });
    }
  }
}(jQuery));`


check more info how to include js file