I have a simple array which has three elements. My elements are holding simple paragraph formatted text:
var quoteList = new Array(
"<p>One</p>",
"<p>Two</p>",
"<p>Three</p>"
);
This initialisation is done in my header. Now, in my body I print them by doing a simple document.write;
for(i=0; i<quoteList.length();i++)
{
document.write(quoteList[i]);
}
This works, it prints out my three paragraph formatted text elements held in my array.
Now, I want to scroll through them when a, <a href> tag is clicked, but I'm having issues even getting some of my elements showing, and some hiding, see example;
quoteList[0].style.display="block";
quoteList[1].style.display="none";
quoteList[2].style.display="none";
This doesn't seem to be working. So, I have two issues:
- Cycling through my array elements on mouseClick
- I can't even get my quoteList elements hidden / visible.