<!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=utf-8" />
<title>无标题文档</title>
<script language="javascript">
<html xmlns=" http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script language="javascript">
function fun1(){
//alert(window.close());
//var text=document.color.username;
var checkbox=document.color.a;
for(var i=0;i<checkbox.length;i++){
if(checkbox[i].checked){
alert(checkbox[i].value);
}
}
var radio=document.color.b;
for(var i=0;i<radio.length;i++)
if(radio[i].checked){
break;
}
alert(radio[i].value);
//var myObject=new fun2("aa","dd","cc");
//window.showModalDialog("test2.html",text,"")
}
function fun3(color){
document.color.username.style.backgroundColor=color;
}
function fun2(a1,a2,a3){
this.a1=a1;
this.a2=a2;
this.a3=a3;
this.showMessage=function(){
return "a1="+a1+" a2="+a2+" a3="+a3;
};
}
</script>
</head>
<body>
<!--<input type="button" value="按钮" οnclick="fun()" /
<input type="button" value="弹出一个新窗口" οnclick="fun1()" />>-->
<form action="a.jsp" name="color" method="post">
username:<input type="text" name="username" />
<input type="button" value="提交" οnclick="fun1()"/><br/>
<input type="checkbox" name="a" value="1" />4<br />
<input type="checkbox" name="a" value="2" />5<br />
<input type="checkbox" name="a" value="3" />6<br />
<input type="checkbox" name="a" value="4" />7<br />
<input type="radio" name="b" value="男" />男
<input type="radio" name="b" value="女" />女
<select οnchange="fun3(this.options[this.selectedIndex].value)">
<option name="color" value="red">红色</option>
<option name="color" value="yellow">黄色</option>
<option name="color" value="blue">蓝色</option>
<option name="color" value="green">绿色</option>
<option name="color" value="black">黑色</option>
</select>
</form>
</body>
</html>
<!--<input type="button" value="按钮" οnclick="fun()" /
<input type="button" value="弹出一个新窗口" οnclick="fun1()" />>-->
<form action="a.jsp" name="color" method="post">
username:<input type="text" name="username" />
<input type="button" value="提交" οnclick="fun1()"/><br/>
<input type="checkbox" name="a" value="1" />4<br />
<input type="checkbox" name="a" value="2" />5<br />
<input type="checkbox" name="a" value="3" />6<br />
<input type="checkbox" name="a" value="4" />7<br />
<input type="radio" name="b" value="男" />男
<input type="radio" name="b" value="女" />女
<select οnchange="fun3(this.options[this.selectedIndex].value)">
<option name="color" value="red">红色</option>
<option name="color" value="yellow">黄色</option>
<option name="color" value="blue">蓝色</option>
<option name="color" value="green">绿色</option>
<option name="color" value="black">黑色</option>
</select>
</form>
</body>
</html>