<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
</head>
<body>
<h2>Getting Parent HTML Element</h2>
<p id="01">Hello World!</p>
<p id="02">Hello Sweden!</p>
<p id="demo"></p>
<script>
$(document).ready(function() {
$("#demo").text($("#02").parent().prop("nodeName"));
});
</script>
</body>
<!-- Mirrored from www.w3schools.com/js/tryit.asp?filename=tryjs_jquery_getparent by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 21 Dec 2022 17:07:06 GMT -->
</html>