Я знаю, что с учетом селектора элемента он может можно сделать с помощью
Код: Выделить всё
const item = document.querySelector(query);
const parent = item.parentElement;
Подробнее здесь: https://stackoverflow.com/questions/521 ... -in-nodejs
Код: Выделить всё
const item = document.querySelector(query);
const parent = item.parentElement;