1. js实现背景图片替换
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>test.html</title>
<SCRIPT src="1.js"></SCRIPT>
<SCRIPT language="javaScript">
function go()
{
document.getElementById("button").style.background="url(2.jpg)";
//document.getElementById("button").style.
}
</SCRIPT>
</head>
<body>
<input onclick="go()" id="button" type="button" style="width:350;height:300;background:url(1.jpg);">
<input type="button" value="test" onclick="go()"/>
</body>
</html>
2.注意用js提交表单的时候,提供表单提交功能的button的名字不能定义成submit,不然会导致formName无法提交!