-
-
Save Scordavis/45e8bc58287f821f3b2a3ef125ce0c13 to your computer and use it in GitHub Desktop.
Wrap first letter of Sentence in tag (span) with class
This file contains 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
$(function(){ | |
var a = new String; | |
a = $('.section-heading').html(); | |
var b = a.indexOf(' '); | |
if (b == -1) { | |
b = a.length; | |
} | |
$('.section-heading').html('<span>'+a.substring(0, 1)+'</span>'+a.substring(b, 1)+a.substring(b, a.length)); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment