Text Convert Single Letters with Class Name

/*Text Convert Letters with Class Name*/
 $.fn.texter = function () {
                //debugger;
                var letters = $(this).html().split(""),
                    text = "";

                for (var i in letters) {
                    text += "<span class='" + letters[i] + "'>" + letters[i] + "</span>";
                    //console.log(letters[i]);
                }

                $(this).html(text);
            };

            $(".text").texter();


/********************************HTML*******************************************/

<div class="text">Test Message</div>

Comments

Popular posts from this blog

Scroll After Fixed Navigation

Bootstrap CSS Customize with SCSS CSS

Best way to prevent page scrolling on drag (mobile)