From jQuery api we can make own custom function¬† like: (function($) { $.fn.Vaucher = function(options) { var st = $.extend({ ‘seprate’: 4, }, options); return this.each(function() { var cur_ele = $(this); val = cur_ele.text(); val = val.trim() if(val.length<=13){ var arr = Array.prototype.slice.call(val), output = []; while (arr.length) output.push(arr.splice(0, st.seprate).join(”)); result = ” for(i=0;i<output.length;i++) { if […]