java 网页脚本小程序

来源:百度知道 编辑:UC知道 时间:2024/06/03 21:40:47
网页显示两个按钮,一个点击下会改变网页背景颜色,另一个点击下会恢复最开始的颜色。谢谢了

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
<!--
.color {
background-color: yellow;
}
-->
</style>
</head>

<body id="b">
<input type="button" name="Submit" value="按钮" onclick="javascript:document.getElementById('b').className='color'"/>
<input type="button" name=&q