代码改变世界

利用Vbscript改变背景颜色

2011-06-15 11:07  qinuo  阅读(506)  评论(0编辑  收藏  举报

下面一段代码也许会帮得到你:

<html>
<head>
<title>if....then语句使用</title>
<script language="vbscript">
<!--
sub bchange(choice)
if choice="1" then
document.bgcolor="red"
elseif choice="2" Then
document.bgcolor="yellow"
elseif choice="3" Then
document.bgcolor="blue"
elseif choice="4" then 
document.bgcolor="green"
else 
document.bgcolor="black"
End If
end sub
-->
</script>
</head>
<body>
<center>
<h2><font color ="#ff0000">文字和背景颜色的选择</font></h2><p>
<form>
<table border="2">
<tr>
<th>背景颜色</th><th>选择</th><th>文字颜色</th><th>选择</th></tr>
<tr>
<td>红色</td><td><input type="radio"name="a" onclick="bchange(1)"></td>
<td>黄色</td><td><input type="radio" name="a" onclick="bchange(2)"></td>
</tr>
<tr>
<td>蓝色</td><td><input type="radio" name="a" onclick="bchange(3)"></td>
<td>绿色</td><td><input type="radio"  name="a" onclick="bchange(4)"></td>
</tr>
</table>
</form>
</center>
<html>

 

电话录音系统录入