This is driving me crazy. Seems like it should alert with the innerHTML from each <p> element, but it doesn't.
Code:
<script>
function doit() {
items=document.getElementsByTagName("p");
for(var i=0; i<items.length; i++);
{
alert(items[i].innerHTML);
}//end for loop
}//end foo
</script>
<p>abc</p>
<p>xyz</p>
<button onclick="doit()"> CLICK </button>