AngelicKnight
MIS
I'm a JS newbie in dire need of advice for my something I'm working on for my senior project. I need to create a button that links to another website. That's usually a simple matter of filling in the "onclick" field with the website address, but the way I need to do it has a twist. Instead of doing it in straight HTML, I need JavaScript. Here is, in essence, what I'm trying to pull off:
First, I have an array in which each member of that array is a website, as such:
var links = new array(3);
links[0]="links[2]="links[3]="
Next, I have three buttons in my HTML in the body that I need to link to each website, respectively. So, what do I do with the "onclick" field so that it calls up the JavaScript above (I presume through a function I must create) and goes to one of the websites in the array?
First, I have an array in which each member of that array is a website, as such:
var links = new array(3);
links[0]="links[2]="links[3]="
Next, I have three buttons in my HTML in the body that I need to link to each website, respectively. So, what do I do with the "onclick" field so that it calls up the JavaScript above (I presume through a function I must create) and goes to one of the websites in the array?