鼠标移动改变CSS样式
程序员文章站
2024-02-12 17:58:46
...
<style type="text/css">
.changeColor {
font-size: 14px;
color:#FFF;
background-color: #09C;
text-decoration: underline;
}
.original {
font-size: 14px;
color: #09C;
text-decoration: underline;
}
</style>
<script language="javascript">
function changeBlue(){
document.getElementById('change').className="original";
}
function changeRed(){
document.getElementById('change').className="changeColor";
}
</script>
</head>
<body>
<span class="original" id="change" onmouseover="changeRed()" onmouseout="changeBlue()">变色龙
</span>
</body>
上一篇: MySQL 数据库双主改造