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>
$.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
Post a Comment