Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Gallery {
- constructor(thumbnail, original) {
- this.thumbnail = thumbnail;
- this.original = original;
- }
- createImage() {
- return '<img src="' + this.thumbnail '">';
- }
- }
- var images = new Gallery('http://www.pixic.ru/i/2081W44634K5D3r8.jpg', 'http://www.pixic.ru/i/H0n1549674h5k3C9.jpg');
- window.onload = function() {
- document.getElementById('gallery').innerHTML = images.createImage();
- }
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <link rel="stylesheet" href="style.css">
- <title>Gallery</title>
- </head>
- <body>
- <div id="gallery"></div>
- <script src="script.js"></script>
- </body>
- </html>
Add Comment
Please, Sign In to add comment