| var Associative_array = (function () { function Associative_array() { } Associative_array.prototype.EmpInfo = function () { var information = new Array(); information["Dinesh"] = "Dinesh Beniwal is Administrator of C# corner. His expert arears are ASP.NET, ADO.NET, HTML and PHP."; information["Mahesh"] = "Mahesh Chand is founder of C# Corner. Mahesh has been awarded prestigious Microsoft MVP Award for 7 consecutive years for his contributions to the developer community."; information["Manish"] = "Manish is Very much interested in Microsoft & LifeStyle Accessory Designand working with Microsoft technologies. His expert areas are ASP.NET, ADO.NET, C# .NET and WPF."; var info = prompt("Whose Employee information do you want?",""); if((info == "Dinesh") || (info == "Mahesh") || (info == "Manish")) { var y = document.createElement("y"); y.innerText = information[info]; document.body.appendChild(y); } else { alert("No Information"); } }; return Associative_array; })(); window.onload = function () { var greeter = new Associative_array(); greeter.EmpInfo(); }; |