---
title: "How to disable anchor tag link using jquery?"  
description: "How to disable anchor tag link using jquery?"  
author: "Sushant Mishra"  
published: 2017-07-25  
updated: 2017-07-28  
canonical: https://www.mindstick.com/forum/34324/how-to-disable-anchor-tag-link-using-jquery  
category: "jquery"  
tags: ["jquery", "html"]  
reading_time: 1 minute  

---

# How to disable anchor tag link using jquery?

I want to [disable](https://www.mindstick.com/forum/12901/how-to-disable-enable-input-box-in-aspx-with-value-from-sql) [click](https://www.mindstick.com/articles/12423/social-login-magento-2-one-click-to-register-social) here is my [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii) <a href='' id='ThisLink'>some [text](https://www.mindstick.com/blog/301635/did-people-reinvent-texting-to-express-the-full-range-of-emotions)</a>\
I have done this but it is not workingI can do this easily with a [button](https://www.mindstick.com/articles/63/how-to-add-button-in-datagridview-in-csharp-dot-net) by adding .attr("disabled", "disabled");

## Replies

### Reply by Royce Roy

Here is the solution for this. Hope this helps!\

```
var preventClick = false; $('#ThisLink').click(function(e) {    $(this)       .css('cursor',
'default')      
.css('text-decoration', 'none')     if (!preventClick)
{       
$(this).html($(this).html() + ' lalala');
```


---

Original Source: https://www.mindstick.com/forum/34324/how-to-disable-anchor-tag-link-using-jquery

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
