<section id="n1">
<title>
<p>1</p>
</title>
<p>some text1</p>
</section>
<section id="n2">
<title>
<p>2</p>
</title>
<p>some text2</p>
</section>
<section id="n3">
<title>
<p>3</p>
</title>
<p>some text3</p>
</section>
<script>
window.onload = function () {
var elems = document.getElementsByTagName('section');
var len = elems.length;
for (var i = 0; i < len; i++) {
alert('title: ' + elems[i].children[0].innerHTML.replace(/</g, '<').replace(/>/g, '>') + '\n p: ' + elems[i].children[1].innerHTML);
}
}
</script>