<a href="javascript:void(0)" onclick="alert('ok')">

解决方案 »

  1.   

    <a href=a.htm onclick="if(!confirm('go to '+this.href+'?')) return false;">a</a>
      

  2.   

    <a href="a.htm" onclick="alert();return false">a</a>
      

  3.   

    你需要怎样的信息框呢,看下面有没有你想要的:警告信息框:
    <a href="javascript:void(0)" onclick="alert('ok')">确认对话框:
    <a href="javascript:void(0)" onclick="confirm('ok')">可输入的对话框:
    <a href="javascript:void(0)" onclick="prompt('提示字符串','预设输入值')">
      

  4.   

    <a href="a.htm" onclick="return(confirm('Are u sure?'))">a</a> 
      

  5.   

    其实注意一下在onclick中加上return false就可以了。