您的位置:首页 > Web前端 > JavaScript

javascript改变字体颜色实例

2005-11-17 12:17 399 查看
我写的一个改变字体颜色的实例:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>字体颜色改变实例</title>
<style type="text/css">
<!--
.style1 {color: #FF0000}
.style2 {color: #0000FF}
-->
</style>
</head>
<body>
<script language="javascript">
function gai()
{
if(test.style.color!=\'red\')
test.style.color=\'red\';
else
test.style.color=\'green\';
}
</script>
<p id="test">高增分</p>
<input type="button" value="提交" onClick="gai()">
</body>
</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: