-We created a variable and named it j because the letter j is typing friendly.
-We applied Javascript's built-in link method to our j string.
-We put the url we wanted for the link in quotation marks and parenthesis.
-We stored those results back into j.
-We used Javascript's built-in document.write to print to the browser.
We could have also written this a little differently, like so:
j="This is a good time.";
document.write(j.link('http://google.com'));
ADVANCED: You can also apply more than one method to the string:
j="This is a good time.";
j=j.italics().bold().link('http://google.com');
document.write(j);
or
j="This is a good time.";
document.write(j.italics().bold().link('http://google.com'));
Free Copy and Paste Javascript Code:
<script type="text/javascript">
<!--
i="This is a good time.";
j=i.link('http://google.com');