<html>
<head>
<title>小朋友做数学题</title>
<script type="text/javascript">
var c=1
var x
var i
var a
var b
function create(){
var div1=document.getElementById('div1')
div1.innerHTML=""
var str=""
if(document.getElementById('txt').value=="10以内"){
for (var i=1 i<=10 i++){
var p=document.createElement("p")
a=Math.round(Math.random()*10)
b=Math.round(Math.random()*10)
str+=""+i+"."+a+"+"+b+"="
p.innerHTML=str
div1.appendChild(p)
str=""
/*document.write(i)
document.write(".")
a=Math.round(Math.random()*10)
b=Math.round(Math.random()*10)
document.write(a)
document.write("+")
document.write(b)
document.write("="+"<br/>")*/
}
}
else if(document.getElementById('txt').value=="20以内")
{
for (var i=1 i<=10 i++){
/*document.write(i)
document.write(".")
a=Math.round(Math.random()*20)
b=Math.round(Math.random()*20)
document.write(a)
document.write("+")
document.write(b)
document.write("="+"<br/>")*/
var p=document.createElement("p")
a=Math.round(Math.random()*20)
b=Math.round(Math.random()*20)
str+=""+i+"."+a+"+"+b+"="
p.innerHTML=str
div1.appendChild(p)
str=""
}
}
else
{
for (var i=1 i<=10 i++){
/*document.write(i)
document.write(".")
a=Math.round(Math.random()*100)
b=Math.round(Math.random()*100)
document.write(a)
document.write("+")
document.write(b)
document.write("="+"<br/>")*/
var p=document.createElement("p")
a=Math.round(Math.random()*100)
b=Math.round(Math.random()*100)
str+=""+i+"."+a+"+"+b+"="
p.innerHTML=str
div1.appendChild(p)
str=""
}
}
}
</script>
</head>
<body>
<div>
<p>小朋友学数学</p>
</div>
<div>
<p>选择试题</p>
</div>
<div id="table1">
<table>
<tr>
<td>计算范围</td>
<td>
<select id="txt">
<option value="10以内">10以内</option>
<option value="20以内">20以内</option>
<option value="100以内">100以内</option>
</select>
</td>
</tr>
<tr>
<td>难度</td>
<td>
<select>
<option value="加减运算">加减运算</option>
<option value="乘除运算">乘除运算</option>
<option value="四则混合运算">四则混合运算</option>
</select>
</td>
</tr>
</table>
</div>
<input id="button" type="button" value="开始计算" onClick="create()">
<div style="border:0px solid red width:80%height:500px" id="div1"><div>
</body>
</html>
求采纳
.content{border:1px green solid
position:absolute
margin:3px 0 0 320px
width:323px
height:706px
}
.content .inner p1{
font-size:12px
color:#9fea00
}
.content .inner p2{
font-size:10px
color:#c9c9c9
}
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html>
<head>
<meta http-equiv="Content-Type" content="text/html charset=UTF-8">
<title>登录界面</title>
</head>
<body>
<form>
用户名:<input id="loginName" value="" type="text"><br>
密 码:<input id="password" value="" type="password"><br>
<input type="submit" id="btnlogin" value="登录">&nbsp&nbsp&nbsp&nbsp<input type="reset" id="btnreset" value="取消">
</form>
</body>
</html>
大概就是这样了, 你说的要求排版争取什么意思不明白
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)