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

How to make a link appear after a user clicks on a separate link?

Discussion in 'General Scripting Chat' started by truelux, Aug 20, 2012.

  1. truelux

    truelux Regular Member

    Joined:
    Jun 16, 2011
    Messages:
    298
    Likes Received:
    91
    Is there a script or code that I can use that will make "Link B" active/appear, ONLY IF the user has clicked on "Link A" ?

    Similar to those social sharing scripts but I just want to make sure the person clicked on a link in order for them to continue to link B...

    thanks! :cool:
     
  2. artizhay

    artizhay BANNED BANNED

    Joined:
    Nov 21, 2010
    Messages:
    1,867
    Likes Received:
    1,335
    Something like this should work. Just throw it into an HTML file and test it.

    HTML:
    <html>
    <head>
      <script type="text/javascript">
      function showLinkB() {
         document.getElementById("linkBContainer").innerHTML = "<a href='link-b.html'>Link B</a>";
         return false;
      }
      </script>
    </head>
    <body>
    <a href="javascript:void(0)" onclick="showLinkB();">Link A</a>
    <div id="linkBContainer">Link B will show here.</div>
    </body>
    </html>
     
    • Thanks Thanks x 2
  3. truelux

    truelux Regular Member

    Joined:
    Jun 16, 2011
    Messages:
    298
    Likes Received:
    91
    thanks that worked!
     
  4. SEOnetic

    SEOnetic Senior Member

    Joined:
    May 21, 2012
    Messages:
    995
    Likes Received:
    120
    Thanks man. This will help with my content locking a lot.