...

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



xaverian
10-09-2012, 02:36 PM
Hi,
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.

WolfShade
10-09-2012, 02: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';".

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum