JSFiddle - React, Tailwind, and code Playground

HTML

<span class="rainbow_text">qzx</span>

JavaScript

// ------------------------------------------------------------------------------------------------------ PLUGIN kalininRainbowText IMPLEMENTATION------------
(function($){
	// -------------------------------------------------------------------------------------------------- options ----------	
	$.fn.kalininRainbowText = function(options) {					
		var options = jQuery.extend({
			colorArray: new Array('#974bff', '#ec11a1', 'navy', 'orange', '#ecb111', 'magenta', '#055d12', '#4bb1ff')
		},options);		
		
		return this.each(function() {
			// ------------------------------------------------------------------------------------------ properties ---------	
			var self = $(this);	
			
			var colorArrayLength  = options.colorArray.length,
				text = self.text(),
				textLength = text.length;

			init();	
			
			// ------------------------------------------------------------------------------------------ methods ------------		
			function init(){
				var	i,
					letterArray = new Array();
				
				for(i = 0; i < textLength; i++){
					letterArray[i] = text[i];
				}
				
				colorize(i, letterArray);	
			}
			
			function colorize(textLength, letterArray){
				var	i,
					newText;
				
				for(i = 0; i < textLength; i++){
					q = letterArray[i];
					letterArray[i] = '<span>' + q + '</span>';

					newText += letterArray[i];

				}
				
				alert(newText);
			}
			
			function deColorize(){
			
			}			
			
			// ------------------------------------------------------------------------------------------ handlers -----------		
			function onClick(){
				alert(1);
			}
			
			// ------------------------------------------------------------------------------------------ events -------------	
			self.on('click', onClick);			
		});
	};
})(jQuery);


				// --------------------------------------------------------------------- PLUGIN kalininRainbowText INITIALIZATION------------
				$('.rainbow_text').kalininRainbowText({
					colorArray: new Array('red', 'lime', 'blue', 'cyan',...