This should be a simple one, and yet I need help to solve the problem: I need to remove the element with the class "goup" on it from the DOM tree with javascript (eventually with prototype, but no other library). I don't only want to hide that paragraph, but remove it entirely from the DOM tree.
My solution to use getElementsByClassName does not work.
function hidegoup() {
var goup= document.getElementsByTagName("p")
.getElementsByClassName("goup");
goup.style.display = 'none';
goup.removeChild();
}
THE HTML:
<div id="poems">
<div class="poem" id="d1">
<p class="goup">
<a href="#">To the top of the page</a>
</p>
</div>
</div>