#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    1
    Rep Power
    0

    Call both Url and js function


    When I call a url with <a> tag, I write
    <a href="URL">Link</a>

    When I call a function with <a> tag, I write
    <a href="javascript:MyFunction()">Function</a>

    Then I would like to know how to do if I want to call both Url Link and the function at the same time.

    Is it that way?
    <a href="URL" onclick="MyFunction()">Link & Function</a>

    Let me know. Thanks.
  2. #2
  3. A Not To Shabby Code Smurf
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Aug 2008
    Posts
    1,044
    Rep Power
    119
    Yes, that is correct.

IMN logo majestic logo threadwatch logo seochat tools logo