Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

disable anchor tag jquery after click

$('.btn').on('click', function(e) {
    e.preventDefault();
    $(this).off("click").attr('href', "javascript: void(0);");
   //add .off() if you don't want to trigger any event associated with this link
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: remove last comma from string javascript 
Javascript :: adding a button in javascript 
Javascript :: javascript remove all whitespaces 
Javascript :: brain.js cdn 
Javascript :: get window width jquery 
Javascript :: select onchange jquery get the selected option data attribute 
Javascript :: leaflet.js cdn 
Javascript :: javascript int max 
Javascript :: javascript reverse a string 
Javascript :: javascript convert between string and ascii 
Javascript :: best way to detect mobile device jquery 
Javascript :: angular pipe first letter uppercase 
Javascript :: js get numbers only 
Javascript :: js new line regex 
Javascript :: innerwidth react 
Javascript :: remove element by class 
Javascript :: ajax header jquery 
Javascript :: jquery is numeric 
Javascript :: update node js ubuntu 
Javascript :: regular expression alphanumeric with spaces java script 
Javascript :: js event listener url change 
Javascript :: heroicons nextjs 
Javascript :: sequelize undo last migration 
Javascript :: remove all numbers from string javascript 
Javascript :: on click fade out jquery 
Javascript :: how to play jquery audio 
Javascript :: javascript do arrays intersect 
Javascript :: get localstorage 
Javascript :: javascript regex for firstname 
Javascript :: javascript password generator example 
ADD CONTENT
Topic
Content
Source link
Name
1+5 =