JavaScriptでの親要素の取得について

概要

ある要素の親要素を取得したい場合には、parentelementを使用する。

以下にコード例を示す。

const parentElement = childElement.parentElement;