Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title>Hello World</title>
- <script>if (typeof module === 'object') {window.module = module; module = undefined;}</script>
- <script src="jquery-3.3.1.min.js"></script><!-- jQuery -->
- <script>if (window.module) module = window.module;</script>
- </head>
- <body>
- <h1>Hello World!</h1>
- <div id="displaytext"></div> <!--display text inside-->
- <div id="belowtext">Text 2</div> <!--then should move this below-->
- <script>
- const container = document.getElementById('displaytext');
- function appendNewMessage(msg = '') {
- const div = document.createElement('div');
- div.innerHTML = msg;
- container.appendChild(div);
- }
- ///loop to add text into <div id="displaytext"></div>
- window.setInterval(function(){
- appendNewMessage('add new text');
- }, 10000);
- </script>
- </body>
- </html>
Add Comment
Please, Sign In to add comment