JavaScript parentNode: Get the parent node
Syntax:
nodeObject.parentNode
Among them, nodeObject is the node object (element node).
For example, get the parent node of the node with id="demo":
document.getElementById("demo").parentNode;
For example, get the id="demo" "The parent node of the node:
点击这里获取父节点
Please see the following demonstration: