Using Javascript to output a hyperlink
Feb 05, 2019
By
Andrew F
Hi all,
I'm trying to output a hyperlink into a text box using Javascript. I'm not too familiar with Javascript, but from what I can find online there is a link function that looks like this:
someString.link("url")
...but when I use that, it only outputs the someString variable without the actual link. Is there another way to do this?
Here's the code snippet I'm working with:
for(var i = 1; i <= 13; i++) {
var num = player.GetVar(i.toString(10));
if(player.GetVar(i.toString(10))) {
text = text+player.GetVar("q"+i.toString(10))+"\n";
switch(i) {
case 1:
text = text + rs.link(rsl) + ", " + nt.link(ntl) + ", " + ctq.link(ctgl) + "\n\n";
break;
case 2:
text = text + pr.link(prl) + "\n\n";
break;
};
};
};
player.SetVar("results",text);
Thanks all!
Be the first to reply
This discussion is closed. You can start a new discussion or contact Articulate Support.