Make Javascript output appear in existing window
My ultimate goal is to replace a string generated as a Captivate 8 quiz answer into a format that is useful for my learners.
So far, I have been able to do this using the following script:
var str = "systemanswer";
var res = "myanswer";
str.replace(res);
However, I am virtually illiterate in Javascript, and cannot figure out what script to use to make the new string appear in the same location as the replaced string on my slide.
Using document.write(res); makes the replacement string "myanswer" appear in a new window, but then the learner cannot see the content of the slide in which the original string "systemanswer" appeared.
I would be so grateful if anyone could suggest a line of code that would take care of this issue.
Best,
Laura
