2012/01/03

JavaScript Create Object

Create Object with constructor
http://www.w3schools.com/js/js_objects.asp
function person(firstname,lastname,age,eyecolor) { this.firstname=firstname; this.lastname=lastname; this.age=age; this.eyecolor=eyecolor; this.newlastname=newlastname; } function newlastname(new_lastname) { this.lastname=new_lastname; } var myFather=new person("John","Doe",50,"blue"); var myMother=new person("Sally","Rally",48,"green"); myFather.newlastname("Gu");

No comments:

Post a Comment

Post Code on Blogger

Simplest way to post code to blogger for me: <pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black;overflow-x:...