Toggle class only affects current scene

Hello. I’ve been trying to change language with data tags inside divs. It works great on the current scene but when I jump to the next scene with buttons and divs that has the same classes they will be replaced with their original content.
A small example is the toggle on and off using jquery:

languageDefault = $('.language');

languageDefault.on('click', function() {
    if ($(this).hasClass('toggled')) {
        summaryLang = 'summaryeng';
        homeLang = 'homeeng';
    } else {  
        summaryLang = 'summaryswe';
        homeLang = 'homeswe';

does anyone experiencing the same as I do? That classes can’t be changed over scenes?
Tried addClass and that does not help either. Still not affecting over scenes

guess this is expected behaviour. write your changes to a global var or sessionStorage and apply it on sceneload :slight_smile:

how would you add it to a global var @h_classen ?
Thanks for replying :slight_smile:

summaryLang, homeLang those are the global variables you set, so simply call them on sceneload after a check if they’ve already been set …

ye sorry for not answering but I did that later on and it worked :slight_smile: