Here I get the H1 elements value in a div where the H1 element which has CSS class="myheader":
var nodes = document.getElementById("mydiv")
.getElementsByTagName("H1");
for(i=0;i
Here is the markup:
I would also recommend to use jQuery if you need a heavy parsing for your DOM.