Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-09-2012, 01:36 PM   PM User | #1
xaverian
New Coder

 
Join Date: May 2012
Posts: 46
Thanks: 3
Thanked 0 Times in 0 Posts
xaverian is an unknown quantity at this point
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.
xaverian is offline   Reply With Quote
Old 10-09-2012, 01:44 PM   PM User | #2
WolfShade
Regular Coder

 
Join Date: Apr 2012
Location: St. Louis, MO, USA
Posts: 946
Thanks: 7
Thanked 97 Times in 97 Posts
WolfShade is an unknown quantity at this point
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".
WolfShade is offline   Reply With Quote
Users who have thanked WolfShade for this post:
xaverian (10-09-2012)
Old 10-09-2012, 01:55 PM   PM User | #3
xaverian
New Coder

 
Join Date: May 2012
Posts: 46
Thanks: 3
Thanked 0 Times in 0 Posts
xaverian is an unknown quantity at this point
Thanks a lot WolfShade. It is working.
xaverian is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:07 AM.


Advertisement
Log in to turn off these ads.