3 Replies Latest reply on Feb 11, 2015 1:39 AM by Mechan V.01

    Is it possible to launch a function from a hyperlink?

    Mechan V.01

      I have a footer type text with two links, one of which i want to launch a function on click.
      It looks something like this:

       

       

      © 2015  Contact  |  Privacy Policy

       

       

      I can pass links using html formatting but i can't get it to launch a function.

      My code so far is this and the function is on Privacy Policy:

       

      sym.$('Text-1').html('© 2015 | <a style="text-decoration: none; color: inherit;" href="http://www.google.com" target="_blank"> Contact </a> | <a style="text-decoration: none; color: inherit;" onclick="sym.myFunction()"> Privacy Policy </a>');

       

      sym.myFunction = function(){

        sym.$("Text-2").show();

      }

       

      Any ideas on what i'm doing wrong?
      Thanks!