dan*_*ald 8 javascript href hyperlink
我正在尝试编写分页代码.一个功能是禁用当前链接,使其看起来像文本并且不可点击.在html页面中,这可以通过省略href属性来实现,如:
<a>Link</a>
Run Code Online (Sandbox Code Playgroud)
我不能在javaScript中这样做,
AvdonPagination.prototype.manageLinks = function(link){
if(link){
this.current.href = '#';
this.current = link;
}else{
this.current = this.links[0];
}
this.current.href = null;
}
Run Code Online (Sandbox Code Playgroud)
因为
this.current.href = null;
Run Code Online (Sandbox Code Playgroud)
产生
<a href="null">Link</a>
Run Code Online (Sandbox Code Playgroud)
我也试过了this.current.href="",this.current.disabled=true但是它们都不起作用.我怎么能实现<a>Link</a>?
| 归档时间: |
|
| 查看次数: |
31320 次 |
| 最近记录: |