I have the following function:
function randq()
{
while(document.getElementById(IDOfParagraph).childNodes.length>0)
{
document.getElementById(IDOfParagraph).removeChild( document.getElementById(IDOfParagraph).firstChild );
}
var q = quotations[Math.round(Math.random()*(quotations.length-1))];
currentParagraph = document.getElementById(IDOfParagraph);
currentParagraph.style.color = ‘rgb(0,195,166)’;
currentParagraph.appendChild( document.createTextNode( q ) );
}
Quite simply, I’d like to set the currentParagraph object’s font to Century Gothic, size 2.
Also, sometimes the resulting currentParagraph has the string ‘undefined’ in it. Is the way i’m using math.random correct? Seems like ‘undefined’ is the result of an out of bounds array index.
Thanks,
Barry