Hi,
I am new to Javscript, and I need some help in accessing a set of <p> tags after <a> tag using getElementsByTagName('p'/'a'); I want to access the <p> tags after <a name="PAGE2">, <a name="PAGE3"> etc.
This is what the HTML body has:
<p class="verdana">First Paragraph </p>
<p class="verdana">Second Paragraph </p>
<a name="PAGE2"></a>
<p class="verdana">Six Paragraph </p>
<p class="verdana">Seven Paragraph </p>
<a name="PAGE3"></a>
<p class="verdana">Ten Paragraph </p>
<p class="verdana">Eleven Paragraph </p>
===
var aList = document.getElementsByTagName('a');
for(var i=0; i<aList.length; i++){
if(aList[i].name.indexOf('PAGE')!=-1){
//alert(aList[i].name);
var nextP = document.getElementsByTagName("a")[i].nextSibling;//getting undefined here
Can you suggest any way of doing this?
Thanks,
Anita