Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <script>
- function bar(){
- baz = document.getElementById('foo').value;
- alert((baz.match(/r/) && 'CR') + ' ' + (baz.match(/n/) && 'LF'));
- document.getElementById('foo').value = "foonbar";
- }
- </script>
- <body onload="bar()">
- <form><textarea id="foo" name="foo">
- </textarea>
- <input type="submit">
- </form>
- </body>
- lines = foo.value.split(/rn|r|n/);
Add Comment
Please, Sign In to add comment