日期:2014-05-16  浏览次数:20421 次

用javascript如何判断一个链接是否被点击过
CSS 点击过变颜色,但还是不知怎么判断?

求助高人怎么做?

------解决方案--------------------
HTML code
<a href="http://www.ijser.cn" target="_blank" id="myLink" onclick="this.setAttribute('isVisited', true)"> ijser.cn </a>

?<button id="checkVisited">Check</button>

------解决方案--------------------
a:visited 就行了啊,哪里需要用js
------解决方案--------------------
JavaScript没学好.... 来学习了....
------解决方案--------------------
是color不是backgroundcolor
------解决方案--------------------
2楼的方法多么简单,你们还判断什么啊!!!!!
HTML code

 <html>
    <head>
         <style>
           a:link{
                color:blue;
            }
            a:visited{
                color:red;
            }
        </style>
    </head>
    <body>
         <a id="a1" href="#test1"></a>
        <a id="a2" href="#test1"></a>
          <a id="a3" href="#test3"></a>
      </body>
 </html>