
Originally Posted by
sk89q
Or without jQuery, since it would be overkill for just this (and that code does it for every link):
Code css:
a.disabled:link, a.disabled:visited { color: grey; }
Code html:
<a href="http://example.com" onclick="this.removeAttribute('href');this.className='disabled'">Link</a>
Or that, but you can narrow the selector down to classes, or anchors within a certain div with jQuery as well (and you wouldn't have to add the onClick even to each anchor)
Code:
$(#document).ready(function(){
$("#disabled a").click(function () {
$(this).fadeTo("fast", .5).removeAttr("href");
});
});
If this is the only thing you need to do jQuery is overkill, like sk89j said.
Bookmarks