Getting if a toggle is checked and set to local variable.
I have a toggle button, and when the value is changed, I wish to set a local variable.
The toggle is called mobiletoggle1_33.
I'm always get an 'undefined' in the console.log.
I wouldn't usually ask for support as I'm learning, but after a fair few hours it's driving me crazy.
I have set an event for the toggle, onchange, and run javascript.
var meme= Tiggzi('mobiletoggle1_33').attr("checked");
console.log(meme);
localStorage.setItem('dealprom', meme);
var me=localStorage.getItem('dealprom');
console.log(me);
Ta.
Dale.