I am struggling with implementing a feature where I have two links, one displayed and the other hidden. Upon clicking the first link, it should disappear and the second link should be displayed. Clicking the second link should then hide itself and show the first link again in its place.
Here is the code snippet I am working with:
HTML
<a class="link-one" href="javascript:void(0)" rel="do-2">Link one</a>
<a class="link-two" href="javascript:void(0)" rel="do-3">Link two</a>
jQuery
$(".link-one").live('click',function(){
//some actions
$(this).hide();
$(".link-two").show().on('click',function(){
//some actions
$(this).hide();
$("link-one").show();
});
});
CSS
.link-two{ display: none;}
I would greatly appreciate any assistance or hints on what might be causing issues with my implementation. Thank you!