File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Disabling Anchor Tags Using jQuery Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Disabling Anchor Tags Using jQuery" Watch "Disabling Anchor Tags Using jQuery" New topic
Author

Disabling Anchor Tags Using jQuery

Kavisha Paranamana
Greenhorn

Joined: Jul 30, 2011
Posts: 25
Hello

I'm developing a web application in these days. I use an <a> tag which is stylized with CSS as a button. I need to make it disabled once the user clicks on it, using jQuery. I tried setting up something like $('#id').attr("disabled", "disabled"); but that didn't work. Does anyone know how to use jquery to disable an anchor tag?


Kavisha Paranamana - Homepage
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15385
    
    6
Kavisha Paranamana
Greenhorn

Joined: Jul 30, 2011
Posts: 25
That works perfectly, Eric. Thanks a lot
Kapil Surendra Shinde
Greenhorn

Joined: Jun 29, 2015
Posts: 1
Eric Pascarello wrote:


Hello Eric,

Could you please let me know how to disable the anchor tag on different button click.
i have use a bootstrap class in anchor tag to be used as button type icon(not actually button).
i have used .on and .off functions to do solve this issue but according to the senior he dosen't allow nd nt sure about running everywhere
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 63053
    
  69

Kapil Surendra Shinde wrote:
i have used .on and .off functions to do solve this issue but according to the senior he dosen't allow nd nt sure about running everywhere

What? What does he mean by that? Makes no sense to me.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Disabling Anchor Tags Using jQuery
 
jQuery in Action, 3rd edition