const parents = document.getElementById("parent").options
document.getElementById('position').addEventListener('change', (e) => {
    var position = e.target.value;
    document.getElementById("parent").value = "";
    parents.forEach((item) => {
        if(item.getAttribute("data-position") == position) {
            item.disabled = false;
        }else{
            item.disabled = true;
        }
    });
});