接着我的上一个问题。我现在有这个:
<a id='testOne'>One</a>
还有这个 JavaScript:
//To remove the title and default action.
$("#testOne").attr("title", "").click(function(e){
e.preventDefault();
}).attr("onclick", null);
//To reset the title and action
$("#testOne").attr("title", "Test One").click(function(e){
doTest('one');
});
但是当我的链接(样式像按钮)被重置时,光标是十字准线而不是指针。我检查了一下,它被设置为auto
。有什么方法可以将其设置为指针吗?
最佳答案
那是因为 anchor 标记中没有 href 属性。试试这个
<a id='testOne' href="#">One</a>
或者
<a id='testOne' href="javascript:void(0);">One</a>
关于jquery - 为什么 anchor 不显示手形光标?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6973058/