Javascript query for 3 dependent cascading drop down for django

I want to design three dependent drop-down menus in Django using javascript. I can design for two variables. Can anyone help me with three variables?

Here I am writing code for two variables.

    $(document).ready(function(){

    var $d = $("#d");
    var $E = $("#E");
    var $options = $E.find('option');
    $d.on('change',function(){
    $.html($options.filter('[value="'+ this.value  +'"]'));
    }).trigger('change');
   
   });
Back to Top