Advertisement
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>Javascript create element Video</title>
- <style>
- #vid {
- width: 80%;
- margin: auto;
- display: block;
- border: 5px solid red;
- padding: 5px;
- }
- </style>
- </head>
- <body>
- <script>
- video = document.createElement('video');
- document.body.appendChild(video);
- video.id = 'vid';
- video.autoplay = true;
- video.muted = true;
- video.loop = true;
- video.controls = true;
- video.src = 'https://1xpto.netlify.app/video/jungle.mp4';
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement