Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <script>
- $( document ).ready(function() {
- for(var i=0;i<2;i++)
- {
- var remove_dot=document.getElementsByTagName("p")[i];
- var remove=remove_dot.innerHTML;
- remove_dot.innerHTML = remove.replace(/[,|.-]+[ ]*([,|.-])/g, "$1");
- }
- });
- </script>
- <body>
- <p>hello , . are you | . why , its ok , .</p>
- <p>hey , . are you | . why | its ok , .</p>
- </body>
- hello . are you . why , its ok .
- hey . are you . why | its ok .
- hello . are you . why and its ok .
- hey . are you . why & its ok .
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement