need some hellp about Hyperlink

Discussion in 'HTML & Website Design' started by johny321, Feb 4, 2010.

  1. #1
    Hi guys,

    yahoo


    if we click yahoo. It simply open yahoo homepage, I am looking such code that open not only yahoo, but also msn, & one other sites with them.

    Is it possible that we can open 3 different sites by clicking a hyperlink, a text hyperlink such as above yahoo.

    can any one can share with me that code.

    any effort will be appreciated

    Thanks
     
    johny321, Feb 4, 2010 IP
  2. Xch4ng3

    Xch4ng3 Member

    Messages:
    62
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    25
    #2
    I don't think you can have one HTML link and have it open multiple links, you would have to use pop ups.

    <html>
    <head>
    <title>openURLs.htm</title>
    <script type="text/javascript">
    function Googles() {
    var http = "http://www.Google.com/";
    var win1 = window.open(http);
    var win2 = window.open(http);
    var win3 = window.open(http);
    }
    </script>
    </head>
    <body>
    <a href="javascript:Googles()">Googles</a>
    </body>
    </html>
    Code (markup):
     
    Xch4ng3, Feb 4, 2010 IP
  3. childgone

    childgone Active Member

    Messages:
    58
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91
    #3
    or if you want to open many different url, you can modify the variables

    
    <html>
    <head>
    <title>openURLs.htm</title>
    <script type="text/javascript">
    function Googles() {
    var http1 = "http://www.google.com/";
    var http2 = "http://www.yahoo.com/";
    var http3 = "http://www.msn.com/";
    var win1 = window.open(http1);
    var win2 = window.open(http2);
    var win3 = window.open(http3);
    }
    </script>
    </head>
    <body>
    <a href="javascript:Googles()">Googles</a>
    </body>
    </html>
    
    Code (markup):
     
    childgone, Feb 5, 2010 IP
  4. beven

    beven Well-Known Member

    Messages:
    483
    Likes Received:
    1
    Best Answers:
    1
    Trophy Points:
    113
    #4
    thanks for providing such a nice solution. really appreciate ur efforts guys
     
    beven, Feb 5, 2010 IP