Using the Book Object Constructor : Objects Object Oriented : Language Basics JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Language Basics » Objects Object Oriented »

 

Using the Book Object Constructor



<html>
<head>
  <title>Using the book object</title>
  <script type="text/javascript">
  <!--
  function book(title, author, ISBN, subject, rating) {
    this.title = title;
    this.author = author;
    this.ISBN = ISBN;
    this.subject = subject;
    this.rating = rating;
    this.show = show;
  }
   
  function show() {
    alert(this.title + this.author + this.ISBN + this.subject + this.rating );
  }
  //-->  </script>
</head>
<body>
  <script type="text/javascript">
  <!--
    dbBook = new book("Title""Author","1-11111-111-1",  "Computer"5);
    dbBook.show();
  //-->
  </script>
</body>
</html>



           
       



-

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo Language Basics
» Objects Object Oriented