DHTML 会将href属性中的字符串当作是一个连接地址,如果你想实现即有提示框又可以连接到所需网址,你可用onclick来实现
<a onclick="javascript:alert('a');this.href='http://www.sina.com.cn';" style="cursor:hand;">a</a>

解决方案 »

  1.   

    <a href="javascript:void(0)" onclick="javascript:alert('a');" style="cursor:hand;">wwwwwwww </a>
      

  2.   

    <base target="_self"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
        <head>
         <base target="_self">
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
            <title>base target</title>
        </head>
        <body>
            <a href="javascript:alert('aaaaa');">aaaa</a>
        </body>
    </html>
      

  3.   

    <a href="javascript:alert('aaaaa'); void(0)"> 
      

  4.   

    LZ好像问的是why而不是how 盼达人解惑