help on how to change document.location and innerHTML of a span in new doc - TechRepublic
General discussion
October 22, 2003 at 10:20 AM
kbowen

help on how to change document.location and innerHTML of a span in new doc

by kbowen . Updated 22 years, 8 months ago

Hello,

HELP!!!! I am at a lost of what to do. I need to changed the document.location to a news/index.html page. Here’s the twist. I need to change the innerHTML of a span tag on the new page, news/index.html. Here’s the code I have to date…. Changes the location great, but not the innerHTML of the span tag.

function getarticle(artnum, from){
var arttitle = “”;
var article = “”;
document.location.href = “news/index.html”;
if (artnum == 10200302){
arttitle += “the news article title”;
article += “the news article text”;
}
document.getElementById(“arttitle”).innerHTML = arttitle;
document.getElementById(“article”).innerHTML = article;
}

Thank you in advance for any help you can provide.
Kim

This discussion is locked

All Comments