Forum Moderators: open

Message Too Old, No Replies

How can I make a simple, ordinary link?

         

jozomannen

6:07 pm on Nov 3, 2004 (gmt 0)

10+ Year Member



I need to make a link in javascript, it should work like a:
<a href="site.htm">CLICK HERE</a>

But just be in JavaScript, I have searched google but haven't foung anything, can somebody write the correct code please =)

adni18

7:10 pm on Nov 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<script language="javascript">
window.location="http://www.google.com"
</script>

or, to make a real link,

<script language="javascript">
document.write("<a href=\"[google.com\">Google<]
</script>

whoisgregg

2:34 am on Nov 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Or use single quotes to avoid escaping the "s, especially useful when you need to write out additional values:

<script language="javascript">
document.write('<a href="http://www.google.com" title="Search Engine Named Google">Google</a>');
</script>