Anchor Tag

Hi all,
Here is my problem.I want to Disable few links in my menu. I am using anchor tags. Is there any way to disable anchor tags so that i can enable them later.I have tried with disabled feature but it did not work..Is there any alternate solution for this.
Hope to see quick responses from you all.
Thanks a lot in advanced.
With regards
saritha
vsaritha_9Asked:
Who is Participating?
 
svd2002Connect With a Mentor Commented:
You can hide the link whenever you want to disable it and display just the text instead of link like this:

<A href="http://wwww.hotmail.com" id="TestLink">Test Link</A>
<SPAN id=spnTemp></SPAN>
<INPUT type="button" name="btnDisable" id="btnDisable" value="Disable Link" onClick="TestLink.style.display='none';spnTemp.innerHTML='<U>Test Link</U> ';">
<INPUT type="button" name="btnEnable" id="btnEnable" value="Enable Link" onClick="TestLink.style.display='';spnTemp.innerHTML='';">
0
 
COBOLdinosaurCommented:
If by disabled you mean you want the link to show but not go anywhere, then do it this way:

<a href="#">yourtext</a>

If it is something else you are trying to do please tell us what behaviour you want when it is "disabled".

Cd&
0
 
lexxwernCommented:
or

<a nohref> . . . </a>
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
knightEknightCommented:
you could use the onClick handler to return false ... this would have the effect of disabling the link:

<a href="whatever.html" onClick='return false;'>yourtext</a>
0
 
knightEknightCommented:
... and you could set up a global variable to determine whether or not your links are disabled:

<SCRIPT language='javascript'>
  var linksEnabled = true;
</script>


<a href="whatever.html" onClick='return linksEnabled;'>yourtext</a>

... set linksEnabled to false to disable the links.
0
 
lexxwernCommented:
omg,    svd2002 do you really believe that is


               U S A B L E


???


and btw its better to use visibility than diplay.
0
 
COBOLdinosaurCommented:
Even if it was usable, it would not be cross browser. Might even crash NS4.x

Cd&
0
 
vsaritha_9Author Commented:
Thanks a lot,
It was helpful for us
Saritha
0
 
lexxwernCommented:
oh my god!
0
All Courses

From novice to tech pro — start learning today.