css行内样式
p
// 网页输出字符串
/*
* var 是js所有数据类型
*/
var i = 0;// int i =0;
var j = true;// boolean
var t = "String类型";
var I = 5;
console.log(i);
console.log(j);
console.log(t);
console.log(I);
/*
* js 基本数据类型 Undefind,Boolean,Number,String
*
* typeof 关键字 检测变量的类型
*/
var g;//没给变量初始化就是 Undefind
console.log(g);
document.write("g "+ typeof g + "
");
document.write("I "+ typeof I + "
");
document.write("I "+ typeof t + "
");
document.write("I "+ typeof j + "
");
/**
* 打印九九乘法表
* 等腰三角形
* *
* ***
* *****
* 1到100之和
*/
for(var i ; i<10; i++){
}
//基本函数 function
console.log("调用方法前");
function show(){
console.log("方法");
}
console.log("-->");
//使用函数
show();
console.log("调用方法后");
function parameter(a,b,c){
alert(a+b);
}
parameter(1,2,true);
function return1(a,b){
return a*b;
}
alert("3*4="+return1(3,4));
一键复制
编辑
Web IDE
原始数据
按行查看
历史