1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[Question]Anchor text that drives to 2 or 3 Urls

Discussion in 'HTML & JavaScript' started by sk8tavou, Oct 9, 2011.

  1. sk8tavou

    sk8tavou Senior Member

    Joined:
    Aug 28, 2011
    Messages:
    1,130
    Likes Received:
    1,333
    Hello forum :rolleyes:

    I dont know if you have seen this but sometimes (most at porn sites) when you click in anchor text link or an image you get like 2 to 3 windows open!

    I want to know what HTML code i have to use to make my anchor text link so when someone clicks it drive him in 2 different websites!
    If this is possible!

    Thanks in advance!

    Sk8tavou___
     
  2. BlueZero

    BlueZero Power Member

    Joined:
    Jul 6, 2011
    Messages:
    500
    Likes Received:
    257
    Occupation:
    Webdeveloper, Project Manager
    Location:
    Byte in the Net
    Home Page:
    Its not possible in HTML. But you can do it in JavaScript.
     
  3. Zapdos

    Zapdos Power Member

    Joined:
    Oct 22, 2011
    Messages:
    597
    Likes Received:
    708
    Location:
    Eastern North Carolina
    This is not copy+paste code, its just an example!

    HTML:
    Code:
    <html>
    <head>
        <script src="jquery.js"></script>
    </head>
    <body>
        <a href="#_" id="multi-open">IM A LINK! YAY</a>
        <script>
            $(document).ready(function() {
                $('#multi-open').click(function() {
                    window.open('WEBSITE 1 URL HERE');
                    window.open('WEBSITE 2 URL HERE');
                    window.open('WEBSITE 3 URL HERE');
                });
            });
        </script>
    </body>
    </html>
    
    jQuery is used in the above example.