Create an Object with member method : Member Function : Object Oriented JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Object Oriented » Member Function »

 

Create an Object with member method

















<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;
    this.printEmployee = printEmployee;
}
function printEmployee() {
    document.write("employee Name:    " this.name + "<br>n");
    document.write("Address:          " this.address + "<br>n");
    document.write("Telephone Number: " this.telephone + "<br>n");
    document.write("Email Address:    " this.emailaddress);
}
var newEmployee = new employeeObj("AAA""City, State""555-555-5555""aaa@website.com");
newEmployee.printEmployee();
//-->
</script>
</head>
<body>
</body>
</html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Object Oriented
» Member Function