Created
January 8, 2020 15:11
-
-
Save yankiara/c2ff652b94c39cd602d15303d87ab14c to your computer and use it in GitHub Desktop.
Replace characters in jQuery
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery("h1, h2, h3, h4, h5, h6").each(function() { | |
jQuery(this).html(function(index, text) { | |
return text.replace( /([',.;:?!])/g, '<span class="special">$1</span>' ); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment