Mega Code Archive

 
Categories / JavaScript Tutorial / Object Oriented
 

Object constructor

< html> <head> <script language="Javascript" type = "text/javascript"> <!-- function EmployeeObj (name, address, phone, email) {     this.name = name;     this.address = address;     this.telephone = phone;     this.emailaddress = email; } var newCust = new EmployeeObj("FirstName, LastName", "city, state", "555-555-5555", "fl@website.com"); alert("Hello " + newCust.name); //--> </script> </head> <body> </body> </html>