function commonParentNode(oNode1, oNode2) { if (oNode1 === oNode2) { return oNode1; } const parent1 = oNode1.parentNode; const parent2 = oNode2.parentNode; if (parent1 === oNode2 || parent1 === parent2) { return parent1; } else if (parent2 === oNode1) { ...