View Full Version : How to make a <a href> link disappear

10-09-2012, 01:36 PM
I have a <a href> in my code which is as follows

<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.

10-09-2012, 01:44 PM
<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';".

10-09-2012, 01:55 PM
Thanks a lot WolfShade. It is working.