为什么在href加入链接后菜单字体颜色会还原?如何用js实现菜单点击后变色(不要用target=_blank)
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset = utf-8" />
<style>
a{color:#999;}
</style>
</head>
<body>
<a href="javascript:void(0)" class="item" onclick="changeA()" id="menuA">菜单A</a>
<a href="javascript:void(0)" class="item" onclick="changeB()" id="menuB">菜单B</a>
<a href="javascript:void(0)" class="item" onclick="changeC()" id="menuC">菜单C</a>
<a href="javascript:void(0)" class="item" onclick="changeD()" id="menuD">菜单D</a>
<script type="text/javascript">
function changeA(){
document.getElementById("menuA").style.color='#088888';
document.getElementById("menuB").style.color='#999999';
document.getElementById("menuC").style.color='#999999';
document.getElementById("menuD").style.color='#999999';
}
function changeB(){
document.getElementById("menuB").style.color='#088888';
document.getElementById("menuA").style.color='#999999';
document.getElementById("menuC").style.color='#999999';
document.getElementById("menuD").style.color='#999999';
}
function changeC(){
document.getElementById("menuC").style.color='#088888';
document.getElementById("menuA").style.color='#999999';
document.getElementById("menuB").style.color='#999999';
document.getElementById("menuD").style.color='#999999';
}
function changeD(){
document.getElementById("menuD").style.color='#088888';
document.getElementById("menuA").style.color='#999999';
document.getElementById("menuB").style.color='#999999';
document.getElementById("menuC").style.color='#999999';
}
</script>
</body>
</html>
a:visited {color:#FF000;}