/* this is not idea but should work*/ const div1 = document.querySelector(id/class).parentElement; const adjacentDiv = div1.previousSibling;