Guest User

Untitled

a guest
May 24th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. <!doctype html>
  2. <script>
  3. function bar(){
  4. baz = document.getElementById('foo').value;
  5. alert((baz.match(/r/) && 'CR') + ' ' + (baz.match(/n/) && 'LF'));
  6. document.getElementById('foo').value = "foonbar";
  7. }
  8. </script>
  9. <body onload="bar()">
  10. <form><textarea id="foo" name="foo">
  11.  
  12. </textarea>
  13. <input type="submit">
  14. </form>
  15. </body>
  16.  
  17. lines = foo.value.split(/rn|r|n/);
Add Comment
Please, Sign In to add comment