jquery - How to keep variable's value using localstorage? -


for example have draggable here , once if statement true store 1 in winner variable. after refreshing page or going page still keep value because i'm planning call variable again. how keep variable's value in local storage?

set variable local storage :

//you store key ie. "winner" , value (your variable) localstorage.setitem("winner", winner)  //then value winner = localstorage.getitem("winner") 

Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -