$(document).on("click", '#detail-score', function() { localStorage.setItem("typeStage", 'Diagnostik'); localStorage.setItem("titleStage", $(this).data('titlestage')); window.location.href = '/teacher/games-coordinator/akm/diagnostic/unit/' + roundId; });