3-way dependent drop down using javascript

I am trying a 3-way drop-down using javascript and Django. but the query working only for 2. can anyone help me with this? here i am sharing code

<script>

$(document).ready(function(){
    var $s = $("#s");
    var $department = $("#department");
    var $Employee = $("#Employee");
    var $options = $Employee.find('option');
    var $option1 = $department.find('option');
    $department.on('change',function(){
    $Employee.html($options.filter('[value="'+ this.value  +'"]'));
    }).trigger('change');
    $s.on('change',function(){
      $department.html($options.filter('[value="'+ this.value  +'"]'));
      }).trigger('change');
   });
Back to Top