📜  如何在 javascript 代码示例中启用和禁用 href

📅  最后修改于: 2022-03-11 15:04:26.785000             🧑  作者: Mango

代码示例1
// Example link
// Text
var a = document.getElementById("my-link");
a.originalLink = a.href;
// disable link
a.href = 'javascript:void(0)';
// re-enable link
a.href = a.originalLink;