I wrote a simple array list and for loop statement, and for some reason only the last item in the array list is being called. I need each item in the array list to display, one at a time, after the user clicks on the button. Here's my code so far. Any help would be appreciated. Thanks
var panelTitleArray = [
'Bacon & Cheddar Mash',
'Chipotle & Cilantro Mash',
'Pesto Mash',
'Pancetta & Rosemary Mash',
'Taco Seasoning & Cheddar Mash',
'Roasted Garlic Mash',
'Sour Cream & Chives Mash',
'Corn & Red Pepper Flakes Mash',
'Ranch Dressing Mash',
'Broccoli & Cheddar Mash',
'Old Bay Seasoning Mash',
'Smoked Gouda & Scallions Mash',
'BBQ Mash',
'Horseradish & Chive Mash',
'Parmesan Mash',
'Corn, Broccoli & Carrot Bits Mash',
'Greek Yogurt Mash'
];
$(function panelTitle() {
// $("#st-panelTitle").html(panelTitleArray[0]);
for (var i = 0; i < panelTitleArray.length; i++) {
$("#st-panelTitle").html(panelTitleArray[0]);
$('.arrowNext').click(function(){
$("#st-panelTitle").html(panelTitleArray[i]);
console.log("clicked")
});
};
});