remove items from HTML dropdownList at checkbox un-check event
===

I have a list of check-boxes and a drop-down list.I managed to add elements dynamically to dropdown list when I check the checkboxes.

How can I remove corresponding Items dynamically from drop-down list when I un-check particular checkbox.

Here is my code
    

    
    //<input type="checkbox" name="docCkBox" value="${document.documentName}" onclick="handleChange(this)"/>
    // check box onclick event will call this function
       function handleChange(cb) {
             if (cb.checked)
        {

            // Create an Option object
            var opt = document.createElement("option");
            
            // Add an Option object to Drop Down/List Box
            document.getElementById("query_doc").options.add(opt);
    
            // Assign text and value to Option object
            opt.text = cb.value;
            opt.value = cb.value;
            
            
        }
        
        else{
     
        
    //I want to remove a particuler Item when I uncheck the check-box
    //by below method it will always remove the first element of the dropdown but not the corresponding element

     var opt = document.createElement("option");
     opt.text = cb.value;
     opt.value = cb.value;
     document.getElementById("query_doc").remove(opt);
     
     }
        
             
        }

