Hi,
Is there a way (function) to get the parents (or immediate parent) of a child tag?
e.g.:
<div>
<p id="para">
A simple example
</p>
</div>
How does one get the "div" tag when only the "p" tag is identifiable either via "id" or index?
i.e. is there a function like:
getParentOfChild(document.getElementById("para"))
in JavaScript?
Many thanks in advance
Protonman
Is there a way (function) to get the parents (or immediate parent) of a child tag?
e.g.:
<div>
<p id="para">
A simple example
</p>
</div>
How does one get the "div" tag when only the "p" tag is identifiable either via "id" or index?
i.e. is there a function like:
getParentOfChild(document.getElementById("para"))
in JavaScript?
Many thanks in advance
Protonman