Solved

Anchor Tag

Posted on 2002-06-11
9
2,153 Views
Last Modified: 2012-06-27
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
0
Comment
Question by:vsaritha_9
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7069670
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
 
LVL 12

Expert Comment

by:lexxwern
ID: 7069754
or

<a nohref> . . . </a>
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 7069767
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
 
LVL 33

Expert Comment

by:knightEknight
ID: 7069771
... 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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 2

Accepted Solution

by:
svd2002 earned 50 total points
ID: 7071977
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
 
LVL 12

Expert Comment

by:lexxwern
ID: 7071992
omg,    svd2002 do you really believe that is


               U S A B L E


???


and btw its better to use visibility than diplay.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7072514
Even if it was usable, it would not be cross browser. Might even crash NS4.x

Cd&
0
 

Author Comment

by:vsaritha_9
ID: 7075557
Thanks a lot,
It was helpful for us
Saritha
0
 
LVL 12

Expert Comment

by:lexxwern
ID: 7077225
oh my god!
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now