Forum Moderators: open

Message Too Old, No Replies

Javascript Variable to a hyperlink

         

jbhavin

11:54 am on Aug 29, 2003 (gmt 0)

10+ Year Member



I have stored last part of the url, the html file in a variable and i want to make that variable a hyperlink, so how do i do it?

korkus2000

12:03 pm on Aug 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Do you need to build the entire path or is the variable enogh to create a relative link?

You could drop something like this in the place you want the link:

<script>var variable="relativeLink";document.write("<a href=" + variable + ">" + variable + "</a>");</script>

jbhavin

10:14 am on Aug 30, 2003 (gmt 0)

10+ Year Member



just the variable is enough.

hey in place of relative link what do i type in?

anyways thanks a lot for the code!