输出m的表格
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style type="text/css">
</style>
</head>
<body>
<script type="text/javascript">
/*3、使用函数打印出m乘法表 */
function chengfa(m){
str = "<table align='center'>";
for(var i=1; i<=m;i++){
str += "<tr align='center'>";
for(var j=1; j<=i; j++){
str += "<td style='border:4px solid pink;'>"+ j+"×"+i+"=" +(i*j)+"</td>";
}
str += "</tr>";
}
str += "</table>";
document.write(str);
}
function c(){
var objInput=document.getElementById('input1');
var val=objInput.value;
chengfa(val);
}
</script>
<input type="text" id="input1"/>
<input type="button" value="什么鬼" onclick="c()" />
</body>
</html>