<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script type="text/javascript">
for(var i=1;i<=8;i++){
for(k=1;k<=8-i;k++){
document.write(" ");
}
for(var j=1;j<=(2*i-1);j++){
document.write("*");
}
document.write("<br />");
}
</script>
</head>
<body>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script>
var a = "abc";
document.write(a.split("").reverse().join("")+"<br />");
var str="abc";
var b=new Array(str.length);
var i=str.length-1;
var j=0;
while(i>=0)
{
b[j]=str.charAt(i);
i--;
j++;
}
for(j=0;j<str.length;j++)
{
document.write(b[j]);
}
</script>
</head>
<body>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script>
function com(){
var a = document.getElementsByName("1");
for(var i =0;i<=5;i++){
if(a[i].checked == false)
a[i].checked = true;
else
a[i].checked = false;
}
}
</script>
</head>
<body>
<input type="button" value="反选" onclick="com()" />
<li>
<input type="checkbox" name="1"/>
</li>
<li>
<input type="checkbox" name="1"/>
</li>
<li>
<input type="checkbox" name="1"/>
</li>
<li>
<input type="checkbox" name="1"/>
</li>
<li>
<input type="checkbox" name="1"/>
</li>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script>
var a = prompt("你想要几行数字?");
for(var i =0;i<a;i++){
//1.输入星星前面的空格
var blank=a-i;
for(var k =0;k<blank;++k){
document.write(" ");
}
//2.打印星星
var star = i*2-1;
for(var j =0;j<star;++j){
document.write("1");
}
//3.换行
document.write("<br/>");
}
</script>
</head>
<body>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script>
</script>
</head>
<body>
<input type="text" style="width: 410px;" id="t1"/><br />
<input type="button" value="7" style="width: 100px;" />
<input type="button" value="8" style="width: 100px;" />
<input type="button" value="9" style="width: 100px;" />
<input type="button" value="+" style="width: 100px;" onclick="plus()"/>
<br />
<input type="button" value="4" style="width: 100px;" />
<input type="button" value="5" style="width: 100px;" />
<input type="button" value="6" style="width: 100px;" />
<input type="button" value="-" style="width: 100px;" onclick="minus()" />
<br />
<input type="button" value="1" style="width: 100px;" />
<input type="button" value="2" style="width: 100px;" />
<input type="button" value="3" style="width: 100px;" />
<input type="button" value="*" style="width: 100px;" onclick="multiply()"/>
<br />
<input type="button" value="0" style="width: 100px;" />
<input type="button" value="C" style="width: 100px;" />
<input type="button" value="=" style="width: 100px;" />
<input type="button" value="/" style="width: 100px;" onclick="divide()" />
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script>
var a =[1,2,3];
var arr1 = a;
var arr2 = a.concat();
console.log(arr1);
console.log(arr2);
</script>
</head>
<body>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script>
var year = new Date().getFullYear();
var month = new Date().getMonth()+1;
var str = new Date(year,month,1);
var weekday = new Array("星期日","星期一","星期二","星期三","星期四","星期五","星期六");
console.log("下月1号是"+weekday[str.getDay()]);
</script>
</head>
<body>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script>
function com(){
var pwd1 = document.getElementById("pwd1").value;
if(pwd1.length>=6)
alert("注册成功!");
else
alert("密码长度不能小于6位!");
}
</script>
</head>
<body>
用户名:<input type="text" id="t1" /><br />
密码:<input type="password" id="pwd1" /><br />
<input type="button" value="注册" onclick="com()" />
</body>
</html>