SHARE
TWEET

Untitled

a guest Mar 21st, 2019 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <title>Lab 5</title>
  6. </head>
  7. <script>
  8.     function changeFunction() {
  9.         var text = document.getElementById('textarea').value;
  10.         text = text.replace(/[.,\/#!$%\^&\*;:{}=\-_`~()]/g, '');
  11.         text = text.split(' ');
  12.         var div = document.getElementById('myDiv');
  13.         for (var i = 0; i <= text.length; i++) {
  14.             div.innerHTML += '<p>' + text[i] + '</p><br>';
  15.         }
  16.     }
  17. </script>
  18. <body>
  19. <textarea
  20.         id="textarea"
  21.         rows="4" cols="50">
  22.  
  23. </textarea>
  24. <button type="button" onclick="changeFunction()">Show!</button>
  25. <div id="myDiv">
  26.  
  27. </div>
  28. </body>
  29. </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