I have the following web page with a script in it.
<html>
<head>
<title>Make Your Own Objects test</title>
<script>
function info(self,n,e) {
function showInfo(self,n am, ema) {
document.write( "<hr>");
document.write( "<b>Name: </b>"+nam);
document.write( "<b>Email: </b>"+ema);
}
self.name = n;
self.email= e;
self.show() = showInfo(self.n ame,self.email) ;
}
</script>
</head>
<body>
<script>
ali = info("Ali","ali @ali.com");
zainab = info("Zainab"," zainab@zainab.c om");
ali.show();
zainab.show();
</script>
</body>
</html>
I want the script to make two objects: ali and zainab. These objects
are to have two properties (name and email) and a method (show). The
show method is supposed to display the other two properties of the
object.
Please Help. Thank You. :)
<html>
<head>
<title>Make Your Own Objects test</title>
<script>
function info(self,n,e) {
function showInfo(self,n am, ema) {
document.write( "<hr>");
document.write( "<b>Name: </b>"+nam);
document.write( "<b>Email: </b>"+ema);
}
self.name = n;
self.email= e;
self.show() = showInfo(self.n ame,self.email) ;
}
</script>
</head>
<body>
<script>
ali = info("Ali","ali @ali.com");
zainab = info("Zainab"," zainab@zainab.c om");
ali.show();
zainab.show();
</script>
</body>
</html>
I want the script to make two objects: ali and zainab. These objects
are to have two properties (name and email) and a method (show). The
show method is supposed to display the other two properties of the
object.
Please Help. Thank You. :)
Comment