<input type=button name="a" onclick="changecolor(this,'blue')">
<script>
function changecolor(inputbox, inputcolor){
inputbox.style.background=inputcolor;}
</script>
<script>
function changecolor(inputbox, inputcolor){
inputbox.style.background=inputcolor;}
</script>
解决方案 »
- 谁有比较好的树形菜单+类似IE8标签
- 高手来看看这段英文技术解说
- 为什么xmlHttp.readyState一直是0啊,新手求救
- 求一JS功能,第一个对的给100分!
- 大家帮助我看一下,我要实现下面的功能应该如何写.急急!!在线等大家!!!
- 怎样在网页的任意位置插入编辑框等控件
- 一个获得父框架地址栏地址的问题
- <table><tr><td>2003-12-11</td></tr></table>中的日期转到Excel后变成了数字37966.什么原因,怎么解决呢.用的是owc转出
- Extjs 如何获取父类的其他对象
- 大佬帮帮忙
- 用javascript连接数据库(ASSECC)在线等~~~~~~急~~~~~~`
- 请问,如何打开IE浏览器时不显示工具栏和菜单栏?
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<script language="JavaScript" type="text/JavaScript">function change(){
var u=0
var a=document.getElementsByName("radio1")
for(i=0;i<a.length;i++)
{
if(a[i].checked){u=a[i].value}
}switch(parseInt(u)){
case 1:
document.bgColor="#ff0000"
break;
case 2:
document.bgColor="#ffff00"
break;
case 3:
document.bgColor="#00ff33"
break;
}}</script></head><body><form action="" method="post" name="form1">
<input name="radio1" type="radio" value="1">a
<input name="radio1" type="radio" value="2">b
<input name="radio1" type="radio" value="3">c
<input name="button" type="button" onClick="change()" value="change1">
</form>
</body>
</html>