Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to enable and disable href in javascript

// Example link
// <a id="my-link" href="https://codegrepper.com">Text</a>
var a = document.getElementById("my-link");
a.originalLink = a.href;
// disable link
a.href = 'javascript:void(0)';
// re-enable link
a.href = a.originalLink;
Comment

PREVIOUS NEXT
Code Example
Javascript :: textField space between text flutter 
Javascript :: text to speech using javascript 
Javascript :: js string replaceall 
Javascript :: node js on ctrl c 
Javascript :: mongoose connection nodejs 
Javascript :: js appendchild wait for callback 
Javascript :: jquery grid get all selected row 
Javascript :: valid email patter check jquery 
Javascript :: convert/replace space to dash/hyphen javascript 
Javascript :: convert stream to string javascript 
Javascript :: javascript pad with leading zeros 
Javascript :: find item in object js 
Javascript :: how to send json in js with post 
Javascript :: javascript add new array element to start of array 
Javascript :: package.json: License should be a valid SPDX license expression 
Javascript :: react native detect production 
Javascript :: onclick go to url 
Javascript :: tailwind css calc 
Javascript :: javascript hex to binary 
Javascript :: install tailwind nextjs 
Javascript :: jquery close popup when click outside 
Javascript :: validator pattern angular for number only 
Javascript :: disable eslint next line 
Javascript :: how to make something spawn on a random x axis p5.js 
Javascript :: javascript set input value by class name 
Javascript :: remove multiple values from array javascript 
Javascript :: uniqid js 
Javascript :: convert base64 string to byte array javascript 
Javascript :: fs get random file in folder 
Javascript :: modify root in javascript 
ADD CONTENT
Topic
Content
Source link
Name
6+8 =