Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    May 2012
    Posts
    47
    Thanks
    3
    Thanked 0 Times in 0 Posts

    How to make a <a href> link disappear

    Hi,
    I have a <a href> in my code which is as follows

    Code:
    <a href="javascript:editPage();">[Edit mode]<br></a>
    My requirement is , when I click on that link [Edit mode] it will not be visible anymore. But ofcourse the javascript function editPage() will get successfully
    executed so that my purpose is served.

    Currently the problem is after clicking that link, the function is executed successfully but the link does not disappear.

    Please help. Thanks.

  • #2
    Regular Coder
    Join Date
    Apr 2012
    Location
    St. Louis, MO
    Posts
    985
    Thanks
    7
    Thanked 101 Times in 101 Posts
    Code:
    <a href="javascript:void(0);" onclick="editPage(this);">[Edit mode]</a>
    Give the editPage function an argument variable (ie, function editPage(obj) or such) and the first line would be "obj.style.display = 'none';".
    ^_^

    If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
    *
    The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".

  • Users who have thanked WolfShade for this post:

    xaverian (10-09-2012)

  • #3
    New Coder
    Join Date
    May 2012
    Posts
    47
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Thanks a lot WolfShade. It is working.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •