Link to home
Start Free TrialLog in
Avatar of vsaritha_9
vsaritha_9

asked on

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
Avatar of COBOLdinosaur
COBOLdinosaur
Flag of Canada image

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&
or

<a nohref> . . . </a>
Avatar of knightEknight
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>
... 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.
ASKER CERTIFIED SOLUTION
Avatar of svd2002
svd2002

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
omg,    svd2002 do you really believe that is


               U S A B L E


???


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

Cd&
Avatar of vsaritha_9
vsaritha_9

ASKER

Thanks a lot,
It was helpful for us
Saritha
oh my god!