Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Задача с обект</title>
- </head>
- <body>
- <p id="info"></p>
- <script>
- function Book(title, author, publisher, edition, numofpages) {
- this.title = title;
- this.author = author;
- this.publisher = publisher;
- this.edition = edition;
- this.numofpages = numofpages;
- }
- var book1 = new Book("Има ли живот на Марс", "Оскър Уайлд", "eBooks", "4", "176");
- var book2 = new Book("NASA", "Джордж Грейв", "OpenBook", "1", "143");
- var text1 = "";
- for(let x in book1){
- text1 += book1[x] + " "
- }
- var text2 = "";
- for(let x in book2){
- text2 += book2[x] + " ";
- }
- document.getElementById("info").innerHTML = text1 + "<br>" + text2;
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment