123<meta charset= "Utf-8" >4Learning of <title>javascript Objects </title>56<body>78<script language= "JavaScript" >9document.write (");Ten varperson=NewObject (); OnePerson.id= "10010"; APerson.name= "Heart Grow Fonder"; -Person.age=22; -person.sex= "Male"; theperson.eat=function(){ -document.write ("Eat () method: Men like to eat high-calorie food!" "); - } -person.run=function(){ +document.write ("Run () method: The programmer must consciously exercise the body yo!" "); - } +document.write ("No.:" +person.id+ "<br/>"); Adocument.write ("Name:" +person.name+ "<br/>"); atdocument.write ("Age: +person.age+" <br/> "); -document.write ("Gender:" +person.sex+ "<br/>"); - person.eat (); -document.write ("<br/>"); - Person.run (); -document.write ("<br/>"); indocument.write ("); - varperson=NewPerson ("10011", "Xiao Li", 23, "male"); to functionPerson (id,name,age,sex) { + This. id=ID; - This. name=name; the This. age=Age ; * This. sex=sex; $ This. eat=function(){Panax Notoginsengdocument.write ("Eat () method: Women should eat low-calorie food yo!" "); - } the This. run=function(){ +document.write ("Run () method: The female programmer also must consciously exercise the body yo!" "); A } the } +document.write ("No.:" +person.id+ "<br/>"); -document.write ("Name:" +person.name+ "<br/>"); $document.write ("Age: +person.age+" <br/> "); $document.write ("Gender:" +person.sex+ "<br/>"); - person.eat (); -document.write ("<br/>"); the Person.run (); -document.write ("<br/>");Wuyidocument.write ("); the varPerson={id: "10012", Name: "Xiao Zhao", age:24,sex: "Male", Eat:function(){ -document.write ("Eat (): All men and women like to eat well."); Wu},run:function(){ -document.write ("Run (): The male woman is all lazy yo!" So be conscious! "); About }}; $document.write ("No.:" +person.id+ "<br/>"); -document.write ("Name:" +person.name+ "<br/>"); -document.write ("Age: +person.age+" <br/> "); -document.write ("Gender:" +person.sex+ "<br/>"); A person.eat (); +document.write ("<br/>"); the Person.run (); -document.write ("<br/>"); $</script> the the</body> theLearning and using JavaScript to create objects