function on php file : I have this code that I got from here,

(function() {

    var quotes = $(".quotes");
    var quoteIndex = -1;
    
    function showNextQuote() {
        ++quoteIndex;
        quotes.eq(quoteIndex % quotes.length)
            .fadeIn(2000)
            .delay(2000)
            .fadeOut(2000, showNextQuote);
    }
    
    showNextQuote();
    
})();


I wanna know how to put it in my index php file cause it's not working , knowing that I'm working on a joomla template and the class quote is on one of the modules ... thanks