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 Div</title>
- <style>
- .tube {
- position: absolute;
- top: 10px;
- left: 10px;
- background-color: red;
- text-decoration: none;
- text-align: center;
- color: snow;
- font-family: arial black;
- padding: 5px 20px;
- }
- .div {
- border: 5px solid red;
- display: inline-block;
- position: absolute;
- top: 100px;
- padding: 50px;
- }
- </style>
- </head>
- <body>
- <a class='tube' href='https://www.youtube.com/watch?v=1eKDwXPO15Q' target='_blank'>See it on YouTube</a>
- <script>
- div = document.createElement('div');
- document.body.appendChild(div);
- div.innerHTML = 'Javascript create element div';
- div.className = 'div';
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement