改变按钮状态
<SCRIPT LANGUAGE="JavaScript">
function haha()
{
for(var i=0;i<document.form1.elements.length;i++)
{
if(document.form1.elements[i].name.indexOf("bb")!=-1)
document.form1.elements[i].disabled=!document.form1.elements[i].disabled;
}
}
</SCRIPT>
<BODY><form name=form1>
<INPUT TYPE="button" NAME="aa " value=cindy onclick=haha()>
<INPUT TYPE="button" NAME="bb " value=guoguo>
<INPUT TYPE="button" NAME="bb " value=guoguo>
欢迎来开心人俱乐部
改变字体大小
<script>
function doZoom(size)
{
document.getElementById('zoom').style.fontSize=size+'px'
}
function aa()
{
var newWin=window.open(url);
newWin.document.form1.text1.value=value1;
}
</script>
欢迎来开心人俱乐部
计算
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>仅供幼稚园使用</title>
<script language="javascript">
function shi(form1)
{
var sum1=parseInt(form1.a.value);
var sum2=parseInt(form1.b.value);
if (form1.sdh.value=="+")
{
form1.c.value=sum1+sum2;
}
if (form1.sdh.value=="-")
{
form1.c.value=sum1-sum2;
}
if (form1.sdh.value=="*")
{
form1.c.value=sum1*sum2;
}
if (form1.sdh.value=="/")
{
form1.c.value=sum1/sum2;
}
}
</script>
</head>
<body>
<form name="form1" method="post" action="">
<input name="a" type="text" id="a" size="8" onkeyup='this.value=this.value.replace(/\D/gi,"")'>
<select name="sdh" id="sdh">
<option value="+">+</option>
<option value="-">-</option>
<option value="*">*</option>
<option value="/">/</option>
</select>
<input name="b" type="text" id="b" size="8" onkeyup='this.value=this.value.replace(/\D/gi,"")'>
<input type="button" name="Submit2" value="=" onclick="return shi(this.form)">
<input name="c" type="text" id="c" size="8">
</form>
</body>
</html>
欢迎到来开心人俱乐部
[此贴子已经被作者于2007-8-23 10:21:21编辑过]