How to get the parent DIV ID in JavaScript

Use parentElement.id.

document.getElementById('yourChildElementId').parentElement.id;

Example:

<div id="elementParent">
    <div id="elementChild"></div>
</div>


<script>
    var parentId = document.getElementById('elementChild').parentElement.id;
    console.log(parentId);
</script>

Output (console): elementParent