I’ve written a script that changes the content of a div in the main part of the html,
using:
document.getElementById("id").innerHTML = "the stuff I want to put in the main box";
and an array storing the content so I call changetxt(1) it will change the innerhtml to ‘content[1]’etc.)
What I now want to do is link from another page including the changed content, so for example I link to the ‘where we meet’ content section, (content[2]) but when I link to the html it obviously just shows the default value, I was wondering if there is some way I can link to the content via an Anchor on another page such as –
href="index.html-javascript:changetxt(2);
I’ve not found anything on google or this site explaining how to do so.
many thanks
why not use hash tags?
The link:
index.html#2The javascript in the new page (index.html):