Your question may have one of the following 3 possible scenarios. Choose which one is appropriate for your problem.
Case1) The trick in your question is that since they are links pointing to page1.aspx and page2.aspx respectively, as soon as you click on the link, the new page loads in the browser. Thus, the effect you want to achieve does not really matter.
Case 2) If you have both βOneβ and βTwoβ links on each of the aspx pages, you can also strongly indicate that the link pointing to itself is disabled. (Or also has no link at all).
Case 3) If you have a frame for displaying the links "One", "Two", and you have another frame for loading the contents of both links, then your question makes sense to disable another link. Here is the code for the same.
<html> <a id="a1" href="javascript:void(0)" onclick="toggle(objA1,objA2,'page1.aspx')">One</a> <a id="a2" href="javascript:void(0)" onclick="toggle(objA2,objA1,'page2.aspx')">Two</a> <br><iframe id="ifrm" src=""></iframe> <script> var objA1 = document.getElementById('a1'); var objA2 = document.getElementById('a2'); </script> </html>
Real Red.
source share