日期:2014-05-16 浏览次数:20585 次
<!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>
<style type="text/css">
#bor{width:200px;height:300px;border:double }
</style>
<script type="text/javascript">
function fun1(){
var num =document.getElementById("num").value;
var row =document.getElementById("row").value;
var obj = document.getElementById("bor");
var str = "";
for(var j=0; j<row; j++){
for(var i=0; i<num; i++){
str = str + "*";
}
str+="<br/>";
}
obj.innerHTML = str;
}
</script>
</head>
<body>
<div>
<div>
<p><label>每行的星号个数:<input type="text" name="num" id="num" ></label></p>
<p><label>行数:<input type="text" name="row" id="row"></label></p>
<p><label><input type="button" id="but" value="按钮" onclick="fun1()"></label></p></div>
<div id="bor">
</div>
</div>
</body>
</html>
<!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>
<title