<html> <!-- ARCHIVE by FORTUNECITY.ws --> <head><title>create object</title> <script> <!-- function customerHair(color, leighth, thickness, style) { this.color=color; this.leighth=leighth; this.thickness= thickness; this.style=style; this.picture="null"; this.colorChange=colorChange; this.leighthChange=leighthChange; this.thicknessChange=thicknessChange; this.styleChange=styleChange; this.addUrl=addUrl; this.displayStatus=displayStatus; } function colorChange(newColor) { this.color=newColor; } function leighthChange(newLeighth) { this.leighth=newLeighth; } function thicknessChange(newThickness) { this.thickness=newThickness; } function styleChange(newStyle) { this.style=newStyle; } function addUrl (picture) { this.picture=picture; } function displayStatus() { document.writeln("<pre>"); document.writeln("Hair Color: " + this.color); document.writeln("Hair Thickness: " + this.thickness); document.writeln("Hair leighth: " + this.leighth); document.writeln("Hair style: " + this.style); if (this.picture != "null") { //Notice I use single quote so I can use double quotes in my string document.writeln('<img src="' + this.picture +'"+ >'); } else{ document.writeln("picture: unavailable"); } document.writeln("<pre><br>"); } var lynn = new customerHair("Dark brown", "Short", "Thick", "1111"); var yuan = new customerHair("Brown", "Short", "Thick", "1717"); document.write("<center><b>Lynn</b></center>"); document.write("<b>Befor Change</b>"); lynn.displayStatus(); lynn.colorChange("Golden"); lynn.leighthChange("Long"); lynn.styleChange("2222"); document.write("<b>After Change</b>"); lynn.displayStatus(); document.write("<br><br>"); document.write("<center><b>Yuan</b></center>"); document.write("<b>Befor Change</b>"); yuan.displayStatus(); // --> </script> </head> </body> </head>