假若有两个链接,链接A和链接B,在初始状态下,链接A为黑色,链接B为白色,当鼠标移动到链接B上时,颜色互换,链接A的颜色变为白色,链接B的颜色变为黑色,求高手帮忙编写下...

解决方案 »

  1.   

    简单问,那就简单答了:
    <a id=a href="#" style="color:white">AA</a>
    <a id=b href="#" style="color:black" onmouseover="document.getElementById('a').style.color='black';document.getElementById('b').style.color='white';">BB</a>
      

  2.   

    <a id=a href="#" style="color:white">链接1</a>
    <a id=b href="#" style="color:black" onmouseover="document.getElementById('a').style.color='black';document.getElementById('b').style.color='white';">链接2</a>
      

  3.   


    <a id="a" style="color:White;">链接1</a>
    <a id="b" style="color:black;" onmouseover="this.style.color='white';document.getElementById('a').style.color='black';" 
        onmouseout="this.style.color='black';document.getElementById('a').style.color='white';">链接2</a>
      

  4.   

    <a id="a" style="color:White;">链接1</a>
        <a id="b" style="color:black;" onmouseover="this.style.color='white';document.getElementById('a').style.color='black';" 
        onmouseout="this.style.color='black';document.getElementById('a').style.color='white';">链接2</a>