daily pastebin goal
49%
SHARE
TWEET

Untitled

a guest Jul 12th, 2018 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2.     <html>
  3.       <head>
  4.         <meta charset="UTF-8">
  5.         <title>Hello World</title>
  6.  
  7.         <script>if (typeof module === 'object') {window.module = module; module = undefined;}</script>
  8.         <script src="jquery-3.3.1.min.js"></script><!-- jQuery -->
  9.         <script>if (window.module) module = window.module;</script>
  10.  
  11.       </head>
  12.       <body>
  13.  
  14.      <h1>Hello World!</h1>
  15.      <div id="displaytext"></div> <!--display text inside-->
  16.      <div id="belowtext">Text 2</div> <!--then should move this below-->
  17.  
  18.     <script>
  19.     const container = document.getElementById('displaytext');
  20.     function appendNewMessage(msg = '') {
  21.       const div = document.createElement('div');
  22.       div.innerHTML = msg;
  23.       container.appendChild(div);
  24.     }
  25.  
  26.     ///loop to add text into <div id="displaytext"></div>
  27.  
  28.     window.setInterval(function(){
  29.       appendNewMessage('add new text');
  30.     }, 10000);
  31.     </script>
  32.  
  33.  
  34.       </body>
  35.     </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top