From: JavaEye.com
Pay attention to the definition of object categories in JavaScript, use function to define object categories, and initialize objects using the new operator
function Person(name, age) {
this.name = name;
this.age = age;
this.toString = function() {
document.writeln("[name]:" this.name "
" "[age]:" this .age);
}
}
Complete simple HTML