I\'m trying to fill RSS feed with add to fav utility using jQuery and HTML5 localStorage. What I\'m trying to achieve is when a user clicks on glyphicon-star-empty
Add a change like this inside the for loop,Basically you need to loop over each list element as well as for loop over the array to set it.
$( ".panel-heading" ).each( function( index, element ){
if($(this).text() == arr[i].title.trim()){
$(this).next().removeClass('glyphicon-star-empty');
$(this).next().addClass('glyphicon-star');
}
});
Here is a modified JSfiddle https://jsfiddle.net/ehqefk6j/2/