最佳答案
要完全删除链接,请执行以下操作:
$('a.yourLink').click(function(event) {
$(this).next('.hiddenDiv').show();
window.open(this.href, '_blank');
$(this).remove();
return false;
});
要隐藏链接,请执行以下操作:
$('a.yourLink').click(function(event) {
$(this).next('.hiddenDiv').show();
window.open(this.href, '_blank');
$(this).hide();
return false;
});
请注意,我确实 return false;
而不是 event.preventDefault();
和 event.stopPropagation();
因为它是一样的
关于jquery - 如何删除链接?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6849881/